From 13ef21a46b0881d183d555ddd117d567c3ad58c8 Mon Sep 17 00:00:00 2001 From: Lukas Jungmann Date: Wed, 3 Aug 2022 23:31:51 +0200 Subject: [PATCH 1/3] cleanup in testapps, improve stability on the server Signed-off-by: Lukas Jungmann --- .../jpa/advanced/multitenant/Address.java | 18 +- .../AdvancedMultiTenantTableCreator.java | 3 +- .../jpa/advanced/multitenant/Candidate.java | 7 +- .../models/jpa/advanced/multitenant/Capo.java | 6 +- .../models/jpa/advanced/multitenant/Card.java | 1 - .../jpa/advanced/multitenant/Contract.java | 7 +- .../jpa/advanced/multitenant/Envelope.java | 5 +- .../jpa/advanced/multitenant/MafiaFamily.java | 12 +- .../jpa/advanced/multitenant/Mafioso.java | 7 +- .../jpa/advanced/multitenant/Mason.java | 9 +- .../jpa/advanced/multitenant/PhoneNumber.java | 13 +- .../jpa/advanced/multitenant/Reward.java | 5 +- .../jpa/advanced/multitenant/Soldier.java | 8 +- .../jpa/advanced/multitenant/Supporter.java | 18 +- .../advanced/multitenant/SupporterInfo.java | 9 +- .../multitenant/SupporterInfoSub.java | 7 +- .../models/jpa/advanced/multitenant/Task.java | 9 +- .../jpa/advanced/multitenant/Trowel.java | 1 - .../jpa/advanced/multitenant/Underboss.java | 6 +- .../AdvancedMultiTenantJunitBase.java | 7 +- .../AdvancedMultiTenantSchemaJunitTest.java | 2 +- .../AdvancedMultiTenantTableCJunitTest.java | 3 +- .../AdvancedMultiTenantTableJunitTest.java | 3 +- .../BeanValidationDynamicEntityJunitTest.java | 3 +- .../BeanValidationTableCreator.java | 4 +- .../models/jpa/beanvalidation/Employee.java | 15 +- .../BeanValidationJunitTest.java | 18 +- .../tests/jpa/cacheable/CacheableAllTest.java | 3 +- .../CacheableDisableSelectiveTest.java | 3 +- .../jpa/cacheable/CacheableNoneTest.java | 3 +- .../cacheable/CacheableUnspecifiedTest.java | 3 +- .../models/jpa/cascadedeletes/BranchA.java | 14 +- .../models/jpa/cascadedeletes/BranchB.java | 15 +- .../CascadeDeleteTableCreator.java | 4 +- .../models/jpa/cascadedeletes/LeafA.java | 8 +- .../models/jpa/cascadedeletes/LeafB.java | 6 +- .../jpa/cascadedeletes/MachineState.java | 9 +- .../models/jpa/cascadedeletes/RootA.java | 14 +- .../cascadedeletes/CascadeDeletesTest.java | 12 +- .../models/jpa/complexaggregate/Heart.java | 7 + .../models/jpa/complexaggregate/Torso.java | 7 + .../composite/advanced/member_1/Address.java | 34 +- .../member_1/AdvancedTableCreator_1.java | 3 +- .../composite/advanced/member_1/Customer.java | 4 +- .../advanced/member_1/Department.java | 24 +- .../advanced/member_1/EquipmentCode.java | 7 +- .../advanced/member_1/ReadOnlyIsolated.java | 1 - .../member_2/AdvancedReadTransformer.java | 4 +- .../member_2/AdvancedTableCreator_2.java | 3 +- .../member_2/AdvancedWriteTransformer.java | 4 +- .../composite/advanced/member_2/Employee.java | 56 ++- .../advanced/member_2/EmployeeListener.java | 8 +- .../advanced/member_2/EmploymentPeriod.java | 10 +- .../advanced/member_2/FormerEmployment.java | 7 +- .../member_3/AdvancedTableCreator_3.java | 3 +- .../composite/advanced/member_3/Dealer.java | 15 +- .../advanced/member_3/Equipment.java | 1 - .../advanced/member_3/HugeProject.java | 7 +- .../advanced/member_3/LargeProject.java | 7 +- .../advanced/member_3/PhoneNumber.java | 22 +- .../composite/advanced/member_3/Project.java | 42 +- .../advanced/member_3/SmallProject.java | 5 +- .../jpa/composite/advanced/Customizer.java | 6 +- .../composite/advanced/EmployeePopulator.java | 7 +- .../advanced/EntityManagerJUnitTest.java | 46 +- .../arraypks/PrimitiveArrayPKCachingTest.java | 1 - .../testing/models/jpa/datetime/DateTime.java | 22 +- .../jpa/datetime/DateTimePopulator.java | 10 +- .../tests/jpa/datetime/NullBindingTest.java | 10 +- .../models/jpa/ddlgeneration/ContactInfo.java | 8 +- .../models/jpa/ddlgeneration/Employee.java | 2 +- .../testing/models/jpa/delimited/Address.java | 18 +- .../models/jpa/delimited/Employee.java | 29 +- .../jpa/delimited/EmploymentPeriod.java | 10 +- .../models/jpa/delimited/LargeProject.java | 7 +- .../models/jpa/delimited/PhoneNumber.java | 3 +- .../testing/models/jpa/delimited/Project.java | 39 +- .../models/jpa/delimited/SimpleImage.java | 4 +- .../models/jpa/delimited/SmallProject.java | 5 +- .../tests/jpa/delimited/DelimitedPUTest.java | 18 +- .../models/jpa/extensibility/Address.java | 9 +- .../models/jpa/extensibility/Employee.java | 9 +- .../ExtensibilityTableCreator.java | 1 - .../models/jpa/extensibility/PhoneNumber.java | 13 +- .../jpa/extensibility/ExtensibilityTests.java | 43 +- .../jpa/fieldaccess/QuerySQLTracker.java | 10 +- .../advanced/AdvancedJPAJunitTest.java | 22 +- .../advanced/AdvancedJunitTest.java | 15 +- .../advanced/CallbackEventJUnitTest.java | 10 +- .../advanced/EmployeePopulator.java | 12 +- .../advanced/EntityManagerJUnitTest.java | 42 +- .../advanced/EntityManagerTLRJUnitTest.java | 451 ++++++++++-------- .../ExtendedPersistenceContextJUnitTest.java | 9 +- .../advanced/FAServerTestSuite.java | 5 +- .../JoinedAttributeAdvancedJunitTest.java | 24 +- .../advanced/NamedNativeQueryJUnitTest.java | 4 +- .../fieldaccess/advanced/OSGiTestSuite.java | 5 +- .../OptimisticConcurrencyJUnitTest.java | 17 +- .../ReportQueryAdvancedJUnitTest.java | 19 +- .../ReportQueryConstructorExpressionTest.java | 17 +- .../ReportQueryMultipleReturnTest.java | 9 +- .../advanced/SQLResultSetMappingTest.java | 27 +- .../UpdateAllQueryAdvancedJunitTest.java | 24 +- .../fetchgroups/BaseFetchGroupTests.java | 17 +- .../fetchgroups/FAServerTestSuite.java | 2 +- .../FetchGroupMergeWithCacheTests.java | 9 +- .../FetchGroupTrackerWeavingTests.java | 10 +- .../NestedDefaultFetchGroupTests.java | 11 +- .../fetchgroups/NestedFetchGroupTests.java | 15 +- .../NestedNamedFetchGroupTests.java | 23 +- .../SimpleDefaultFetchGroupTests.java | 16 +- .../fetchgroups/SimpleFetchGroupTests.java | 22 +- .../SimpleNamedFetchGroupTests.java | 16 +- .../SimpleSerializeFetchGroupTests.java | 41 +- .../fieldaccess/relationships/Customer.java | 13 +- .../fieldaccess/relationships/Customer2.java | 7 +- .../relationships/IsolatedItem.java | 10 +- .../jpa/fieldaccess/relationships/Item.java | 12 +- .../jpa/fieldaccess/relationships/Order.java | 9 +- .../relationships/RelationshipsExamples.java | 3 +- .../relationships/SalesPerson.java | 11 +- .../relationships/ExpressionJUnitTest.java | 11 +- .../relationships/FRServerTestSuite.java | 2 +- .../relationships/IsolatedCacheTest.java | 8 +- .../fieldaccess/relationships/JAXBTest.java | 6 +- .../RelationshipModelJUnitTest.java | 16 +- .../UniAndBiDirectionalMappingTest.java | 14 +- .../jpa/jpaadvancedproperties/Customer.java | 4 +- .../JPAAdvPropertiesJUnitTestCase.java | 11 +- .../jpql/datetime/JUnitJPQLDateTimeTest.java | 10 +- .../testing/models/jpa/lob/Image.java | 14 +- .../models/jpa/lob/SerializableNonEntity.java | 4 +- .../tests/jpa/lob/LobJUnitTestCase.java | 10 +- .../testing/models/jpa/metamodel/Board.java | 16 +- .../models/jpa/metamodel/CPUEmbeddedId.java | 8 +- .../models/jpa/metamodel/CompositePK.java | 4 +- .../models/jpa/metamodel/Computer.java | 16 +- .../testing/models/jpa/metamodel/Core.java | 6 +- .../models/jpa/metamodel/Corporation.java | 10 +- .../models/jpa/metamodel/Designer.java | 6 +- .../models/jpa/metamodel/EmbeddedPK.java | 8 +- .../models/jpa/metamodel/Enclosure.java | 4 +- .../EntityChildOfMSRootPropertyAccess.java | 4 +- .../testing/models/jpa/metamodel/Foo.java | 1 + .../models/jpa/metamodel/FooBarId.java | 1 + .../jpa/metamodel/GalacticPosition.java | 6 +- .../jpa/metamodel/HardwareDesigner.java | 4 +- .../models/jpa/metamodel/Manufacturer.java | 19 +- .../testing/models/jpa/metamodel/Memory.java | 6 +- .../models/jpa/metamodel/MultiCoreCPU.java | 8 +- .../models/jpa/metamodel/Observation.java | 8 +- .../testing/models/jpa/metamodel/Person.java | 16 +- .../models/jpa/metamodel/Processor.java | 12 +- .../models/jpa/metamodel/WithInner.java | 4 +- .../jpa/metamodel/EntityManagerImplTest.java | 1 - .../tests/jpa/metamodel/MetamodelTest.java | 24 +- .../jpa/metamodel/MetamodelTestBase.java | 1 - .../models/jpa/orphanremoval/Chassis.java | 7 +- .../models/jpa/orphanremoval/Engine.java | 6 +- .../OrphanRemovalModelTableCreator.java | 5 +- .../models/jpa/orphanremoval/Tire.java | 4 +- .../models/jpa/orphanremoval/Wheel.java | 6 +- .../OrphanRemovalJUnitTestCase.java | 6 +- .../models/jpa/partitioned/Address.java | 12 +- .../models/jpa/partitioned/Department.java | 12 +- .../models/jpa/partitioned/Employee.java | 38 +- .../EmployeePartitioningPolicy.java | 4 +- .../jpa/partitioned/EmployeePopulator.java | 8 +- .../models/jpa/partitioned/LargeProject.java | 4 +- .../models/jpa/partitioned/Office.java | 1 - .../partitioned/PartitionedTableCreator.java | 4 +- .../models/jpa/partitioned/PhoneNumber.java | 15 +- .../models/jpa/partitioned/Project.java | 21 +- .../models/jpa/partitioned/SmallProject.java | 4 +- .../jpa/partitioned/PartitionedTest.java | 10 +- .../jpa/partitioned/PartitionedXMLTest.java | 3 +- .../JPAPerformanceServerTestSuite.java | 9 +- .../TopLinkJPAPerformanceRegressionModel.java | 6 +- .../models/jpa/privateowned/Chassis.java | 17 +- .../models/jpa/privateowned/Engine.java | 17 +- .../models/jpa/privateowned/Mount.java | 2 +- .../PrivateOwnedModelTableCreator.java | 5 +- .../models/jpa/privateowned/SparkPlug.java | 9 +- .../testing/models/jpa/privateowned/Tire.java | 2 +- .../models/jpa/privateowned/Vehicle.java | 14 +- .../models/jpa/privateowned/Wheel.java | 17 +- .../models/jpa/privateowned/WheelNut.java | 8 +- .../models/jpa/privateowned/WheelRim.java | 7 +- .../PrivateOwnedJUnitTestCase.java | 29 +- .../models/jpa/relationships/Auditor.java | 13 +- .../models/jpa/relationships/Customer.java | 25 +- .../CustomerServiceRepresentative.java | 14 +- .../jpa/relationships/IsolatedItem.java | 10 +- .../models/jpa/relationships/Item.java | 18 +- .../models/jpa/relationships/Lego.java | 4 +- .../models/jpa/relationships/Mattel.java | 9 +- .../models/jpa/relationships/MegaBrands.java | 4 +- .../models/jpa/relationships/MtoMEntityA.java | 6 +- .../models/jpa/relationships/Namco.java | 5 +- .../models/jpa/relationships/Order.java | 22 +- .../models/jpa/relationships/OrderCard.java | 4 +- .../models/jpa/relationships/OrderLabel.java | 10 +- .../relationships/RelationshipsExamples.java | 5 +- .../models/jpa/relationships/SalesPerson.java | 14 +- .../models/jpa/relationships/ServiceCall.java | 6 +- .../jpa/relationships/manyToMany/EntityA.java | 16 +- .../jpa/relationships/manyToMany/EntityB.java | 13 +- .../jpa/relationships/manyToMany/EntityC.java | 11 +- .../jpa/relationships/manyToMany/EntityD.java | 6 +- .../OneToOneVirtualAttributeHolder.java | 16 +- .../virtualattribute/VirtualAttribute.java | 10 +- .../VirtualAttributeTableCreator.java | 3 +- .../tests/jpa/relationships/EMQueryTest.java | 18 +- .../jpa/relationships/ExpressionTest.java | 10 +- .../tests/jpa/relationships/IsolatedTest.java | 8 +- .../KeyTypeToManyRelationshipTest.java | 6 +- .../relationships/RelationshipModelTest.java | 29 +- .../RelationshipsServerTestSuite.java | 2 +- .../UniAndBiDirectionalMappingTest.java | 11 +- .../relationships/VirtualAttributeTest.java | 9 +- .../RemoteEntityManagerTest.java | 11 +- .../jpa/sessionbean/ha/EmployeeService.java | 4 +- .../sessionbean/ha/EmployeeServiceBean.java | 6 +- .../jpa/sessionbean/ha/FindAllThread.java | 12 +- .../sessionbean/ha/SessionBeanHATests.java | 34 +- .../jpa/sessionbean/ha/SessionBeanTest.java | 18 +- .../sessionbean/ha/SessionBeanTestsRCM.java | 20 +- .../AttributeConverter.java | 1 - .../AbstractEntityListener.java | 3 +- .../AttributeConverterTestBean.java | 7 +- .../sessionbean/EntityListenerTestBean.java | 1 - .../AttributeConverterInjectionTest.java | 14 +- .../EntityListenerInjectionTest.java | 14 +- .../QueryParameterValidationTest.java | 2 - .../tests/jpa/validation/ValidationTest.java | 17 +- .../AdvancedMultiTenantTableCreator.java | 3 +- .../xml/advanced/multitenant/MafiaFamily.java | 3 +- .../EntityMappingsMultitenant123Test.java | 1 - ...ntityMappingsMultitenantSharedEMFTest.java | 1 - .../composite/advanced/member_1/Address.java | 4 +- .../member_1/AdvancedTableCreator_1.java | 3 +- .../advanced/member_1/CacheAuditor.java | 4 +- .../member_2/AdvancedReadTransformer.java | 4 +- .../member_2/AdvancedTableCreator_2.java | 3 +- .../member_2/AdvancedWriteTransformer.java | 4 +- .../composite/advanced/member_2/Employee.java | 14 +- .../advanced/member_2/EmploymentPeriod.java | 7 +- .../member_3/AdvancedTableCreator_3.java | 3 +- .../composite/advanced/member_3/Dealer.java | 4 +- .../advanced/member_3/PhoneNumber.java | 5 +- .../advanced/member_3/PhoneNumberPK.java | 7 + .../composite/advanced/member_3/Project.java | 7 +- .../composite/advanced/EmployeePopulator.java | 9 +- .../xml/composite/advanced/ModelExamples.java | 4 +- .../XmlCompositeAdvancedJUnitTest.java | 62 +-- .../owning/PhoneNumberPK.java | 7 + .../jpa/xml/merge/inherited/Alpine.java | 6 + .../xml/merge/inherited/TelephoneNumber.java | 6 + .../merge/inherited/TelephoneNumberPK.java | 7 + .../testing/models/nativeapitest/Address.java | 3 +- .../models/nativeapitest/Department.java | 1 - .../models/nativeapitest/Employee.java | 5 +- .../nativeapitest/EmployeeServiceBean.java | 13 +- .../NativeAPITestTableCreator.java | 4 +- .../models/nativeapitest/PhoneNumber.java | 3 +- .../tests/nativeapitest/NativeAPITests.java | 18 +- 266 files changed, 1814 insertions(+), 1397 deletions(-) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Address.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Address.java index ef254d712f9..a2d9aeecdec 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Address.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Address.java @@ -15,14 +15,20 @@ // - 337323: Multi-tenant with shared schema support (part 9) package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.*; -import java.io.Serializable; -import jakarta.persistence.*; - -import static jakarta.persistence.CascadeType.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.Multitenant; +import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; + +import static jakarta.persistence.CascadeType.ALL; import static org.eclipse.persistence.annotations.MultitenantType.SINGLE_TABLE; @Entity(name="MOB_ADDRESS") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/AdvancedMultiTenantTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/AdvancedMultiTenantTableCreator.java index b9bcfc592ca..5c22f8c8221 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/AdvancedMultiTenantTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/AdvancedMultiTenantTableCreator.java @@ -26,7 +26,8 @@ package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedMultiTenantTableCreator extends TogglingFastTableCreator { public AdvancedMultiTenantTableCreator() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Candidate.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Candidate.java index 5c60d844818..1caae595a36 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Candidate.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Candidate.java @@ -15,9 +15,6 @@ // - 376603: Provide for table per tenant support for multitenant applications package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.CollectionTable; import jakarta.persistence.Column; import jakarta.persistence.ElementCollection; @@ -30,10 +27,12 @@ import jakarta.persistence.ManyToOne; import jakarta.persistence.SecondaryTable; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantTableDiscriminator; +import java.util.ArrayList; +import java.util.List; + import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.SUFFIX; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Capo.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Capo.java index 0782ea69c22..0a8516c9fc6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Capo.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Capo.java @@ -17,15 +17,15 @@ // - 337323: Multi-tenant with shared schema support (part 9) package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.Collection; -import java.util.Vector; - import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import java.util.Collection; +import java.util.Vector; + @Entity @DiscriminatorValue("CAPO") @Table(name="JPA_CAPO") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Card.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Card.java index b0c0c0ac311..dbe192546a5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Card.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Card.java @@ -23,7 +23,6 @@ import jakarta.persistence.JoinColumn; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Contract.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Contract.java index 567f126ade0..44742f0d1d8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Contract.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Contract.java @@ -19,9 +19,6 @@ // - 337323: Multi-tenant with shared schema support (part 9) package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.Collection; -import java.util.Vector; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -33,9 +30,11 @@ import jakarta.persistence.NamedQuery; import jakarta.persistence.Table; import jakarta.persistence.Version; - import org.eclipse.persistence.annotations.Multitenant; +import java.util.Collection; +import java.util.Vector; + import static jakarta.persistence.CascadeType.ALL; import static org.eclipse.persistence.annotations.MultitenantType.SINGLE_TABLE; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Envelope.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Envelope.java index 3837a96db3e..4aff9528fad 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Envelope.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Envelope.java @@ -15,8 +15,6 @@ // - 371453: JPA Multi-Tenancy in Bidirectional OneToOne Relation throws ArrayIndexOutOfBoundsException package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import static org.eclipse.persistence.annotations.MultitenantType.SINGLE_TABLE; - import jakarta.persistence.CascadeType; import jakarta.persistence.Column; import jakarta.persistence.Entity; @@ -24,10 +22,11 @@ import jakarta.persistence.Id; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; +import static org.eclipse.persistence.annotations.MultitenantType.SINGLE_TABLE; + @Entity @Table(name="JPA_ENVELOPE") @Multitenant(SINGLE_TABLE) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/MafiaFamily.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/MafiaFamily.java index b529d62d753..f7dfecd4139 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/MafiaFamily.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/MafiaFamily.java @@ -23,11 +23,6 @@ // - 357474: Address primaryKey option from tenant discriminator column package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.Collection; -import java.util.Vector; - -import java.io.Serializable; - import jakarta.persistence.Basic; import jakarta.persistence.CollectionTable; import jakarta.persistence.Column; @@ -43,9 +38,12 @@ import jakarta.persistence.PrimaryKeyJoinColumn; import jakarta.persistence.SecondaryTable; import jakarta.persistence.Table; - -import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; import org.eclipse.persistence.annotations.Multitenant; +import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; import static jakarta.persistence.CascadeType.ALL; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mafioso.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mafioso.java index a71b562f650..889e51cb5b9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mafioso.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mafioso.java @@ -19,9 +19,6 @@ // - 357474: Address primaryKey option from tenant discriminator column package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorColumn; import jakarta.persistence.Entity; @@ -32,13 +29,15 @@ import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.ConversionValue; import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.ObjectTypeConverter; import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; +import java.util.ArrayList; +import java.util.List; + import static jakarta.persistence.CascadeType.PERSIST; import static jakarta.persistence.InheritanceType.JOINED; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mason.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mason.java index 910277ca71a..e09a19736c9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mason.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Mason.java @@ -15,10 +15,6 @@ // - 376603: Provide for table per tenant support for multitenant applications package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - import jakarta.persistence.CollectionTable; import jakarta.persistence.Column; import jakarta.persistence.ElementCollection; @@ -30,9 +26,12 @@ import jakarta.persistence.MapKeyTemporal; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + import static jakarta.persistence.TemporalType.DATE; import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/PhoneNumber.java index d60c0f14c7d..979b21e5363 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/PhoneNumber.java @@ -15,13 +15,18 @@ // - 357474: Address primaryKey option from tenant discriminator column package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.io.*; - -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.IdClass; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; +import java.io.Serializable; +import java.io.StringWriter; + @Entity(name="MT_PHONENUMBER") @IdClass(PhoneNumberPK.class) @Multitenant diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Reward.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Reward.java index 2687a1ea6af..facaa0896ed 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Reward.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Reward.java @@ -15,8 +15,6 @@ // - 337323: Multi-tenant with shared schema support (part 9) package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import static org.eclipse.persistence.annotations.MultitenantType.SINGLE_TABLE; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -24,10 +22,11 @@ import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; +import static org.eclipse.persistence.annotations.MultitenantType.SINGLE_TABLE; + @Entity @Multitenant(SINGLE_TABLE) @TenantDiscriminatorColumn(name="T_ID", contextProperty="tenant.id") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Soldier.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Soldier.java index 7447c80dd0b..2176e53a711 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Soldier.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Soldier.java @@ -17,15 +17,15 @@ // - 337323: Multi-tenant with shared schema support (part 9) package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.Collection; -import java.util.Vector; - import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; -import jakarta.persistence.ManyToOne; import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; +import java.util.Collection; +import java.util.Vector; + import static jakarta.persistence.CascadeType.ALL; @Entity diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Supporter.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Supporter.java index d5cd91a21e3..aed25155cef 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Supporter.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Supporter.java @@ -19,27 +19,25 @@ // - 394524: Invalid query key [...] in expression package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import static jakarta.persistence.CascadeType.PERSIST; - -import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; -import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.PREFIX; - -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToMany; -import jakarta.persistence.NamedQuery; import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantTableDiscriminator; +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.CascadeType.PERSIST; +import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; +import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.PREFIX; + @Entity @Table(name="JPA_SUPPORTER") @Multitenant(TABLE_PER_TENANT) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfo.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfo.java index 96d5eaf462b..f817fecf51d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfo.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfo.java @@ -15,10 +15,6 @@ // - 394524: Invalid query key [...] in expression package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import static jakarta.persistence.CascadeType.PERSIST; -import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; -import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.PREFIX; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -26,10 +22,13 @@ import jakarta.persistence.JoinColumn; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantTableDiscriminator; +import static jakarta.persistence.CascadeType.PERSIST; +import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; +import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.PREFIX; + @Entity @Table(name="JPA_SUPPORTER_INFO") @Multitenant(TABLE_PER_TENANT) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfoSub.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfoSub.java index 350d79d7e98..60794c3a58a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfoSub.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/SupporterInfoSub.java @@ -15,18 +15,17 @@ // - 394524: Invalid query key [...] in expression package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; -import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.PREFIX; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantTableDiscriminator; +import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; +import static org.eclipse.persistence.annotations.TenantTableDiscriminatorType.PREFIX; + @Entity @Table(name="JPA_SUPPORTER_INFO_SUB") @Multitenant(TABLE_PER_TENANT) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Task.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Task.java index 69d7a9b1618..d12e801440f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Task.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Task.java @@ -17,10 +17,6 @@ // - 363820: Issue with clone method from VPDMultitenantPolicy package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Cacheable; import jakarta.persistence.Column; import jakarta.persistence.DiscriminatorColumn; @@ -32,10 +28,13 @@ import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import org.eclipse.persistence.annotations.TenantDiscriminatorColumn; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + import static jakarta.persistence.InheritanceType.SINGLE_TABLE; import static org.eclipse.persistence.annotations.MultitenantType.VPD; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Trowel.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Trowel.java index 9da4f0cd9ad..36e5ee1802e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Trowel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Trowel.java @@ -21,7 +21,6 @@ import jakarta.persistence.Id; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Multitenant; import static org.eclipse.persistence.annotations.MultitenantType.TABLE_PER_TENANT; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Underboss.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Underboss.java index 277bca9f736..c0444ce9e6e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Underboss.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/advanced/multitenant/Underboss.java @@ -17,15 +17,15 @@ // - 337323: Multi-tenant with shared schema support (part 9) package org.eclipse.persistence.testing.models.jpa.advanced.multitenant; -import java.util.Collection; -import java.util.Vector; - import jakarta.persistence.DiscriminatorValue; import jakarta.persistence.Entity; import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; +import java.util.Collection; +import java.util.Vector; + import static jakarta.persistence.CascadeType.ALL; @Entity diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantJunitBase.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantJunitBase.java index c2cfc2615d8..2e1125f6d46 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantJunitBase.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantJunitBase.java @@ -41,13 +41,12 @@ // - 394524: Invalid query key [...] in expression package org.eclipse.persistence.testing.tests.jpa.advanced.multitenant; -import java.util.ArrayList; -import java.util.List; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - import org.eclipse.persistence.testing.models.jpa.advanced.multitenant.AdvancedMultiTenantTableCreator; +import java.util.ArrayList; +import java.util.List; + public class AdvancedMultiTenantJunitBase extends JUnitTestCase { public static long candidateAId; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantSchemaJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantSchemaJunitTest.java index d1a38394c22..9da95e09f2f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantSchemaJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantSchemaJunitTest.java @@ -30,10 +30,10 @@ import org.eclipse.persistence.sessions.DatabaseLogin; import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.server.ServerSession; +import org.eclipse.persistence.testing.framework.TestDataSource; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper; import org.eclipse.persistence.testing.models.jpa.advanced.Customer; -import org.eclipse.persistence.testing.framework.TestDataSource; import org.eclipse.persistence.testing.models.jpa.advanced.multitenant.AdvancedMultiTenantTableCreator; import javax.sql.DataSource; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableCJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableCJunitTest.java index 5b3dcda2a1b..ce654040d43 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableCJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableCJunitTest.java @@ -20,7 +20,8 @@ package org.eclipse.persistence.testing.tests.jpa.advanced.multitenant; import jakarta.persistence.EntityManager; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.testing.models.jpa.advanced.multitenant.Candidate; import org.eclipse.persistence.testing.models.jpa.advanced.multitenant.Mason; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableJunitTest.java index 7a994f06246..89b06f4a8b5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/advanced/multitenant/AdvancedMultiTenantTableJunitTest.java @@ -20,7 +20,8 @@ package org.eclipse.persistence.testing.tests.jpa.advanced.multitenant; import jakarta.persistence.EntityManager; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.config.EntityManagerProperties; import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.testing.models.jpa.advanced.multitenant.Candidate; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation.dynamic/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/dynamic/BeanValidationDynamicEntityJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation.dynamic/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/dynamic/BeanValidationDynamicEntityJunitTest.java index 8e1a2eaa286..4b068ebdb7d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation.dynamic/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/dynamic/BeanValidationDynamicEntityJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation.dynamic/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/dynamic/BeanValidationDynamicEntityJunitTest.java @@ -14,9 +14,8 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; -import jakarta.validation.ConstraintViolationException; import jakarta.validation.ConstraintViolation; - +import jakarta.validation.ConstraintViolationException; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.persistence.config.PersistenceUnitProperties; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/BeanValidationTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/BeanValidationTableCreator.java index 63d83f8ff98..a5216a0dae3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/BeanValidationTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/BeanValidationTableCreator.java @@ -13,7 +13,9 @@ // Contributors: package org.eclipse.persistence.testing.models.jpa.beanvalidation; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableCreator; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class BeanValidationTableCreator extends TableCreator { public BeanValidationTableCreator() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/Employee.java index 4a6515c59b0..350237573ec 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/main/java/org/eclipse/persistence/testing/models/jpa/beanvalidation/Employee.java @@ -14,11 +14,20 @@ package org.eclipse.persistence.testing.models.jpa.beanvalidation; -import jakarta.persistence.*; +import jakarta.persistence.Basic; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.validation.Valid; +import jakarta.validation.constraints.Max; import jakarta.validation.constraints.Min; import jakarta.validation.constraints.Size; -import jakarta.validation.constraints.Max; -import jakarta.validation.Valid; + import java.util.Collection; @Entity(name = "CMP3_BV_EMPLOYEE") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/BeanValidationJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/BeanValidationJunitTest.java index 543aa06788e..3cec19502be 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/BeanValidationJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.beanvalidation/src/test/java/org/eclipse/persistence/testing/tests/jpa/beanvalidation/BeanValidationJunitTest.java @@ -14,19 +14,13 @@ // Marcel Valovy package org.eclipse.persistence.testing.tests.jpa.beanvalidation; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.TypedQuery; import jakarta.validation.ConstraintViolation; import jakarta.validation.ConstraintViolationException; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.logging.SessionLog; import org.eclipse.persistence.mappings.ForeignReferenceMapping; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; @@ -35,8 +29,12 @@ import org.eclipse.persistence.testing.models.jpa.beanvalidation.Employee; import org.eclipse.persistence.testing.models.jpa.beanvalidation.Project; -import junit.framework.Test; -import junit.framework.TestSuite; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; public class BeanValidationJunitTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableAllTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableAllTest.java index 41cbee6883f..8bdb8f965f9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableAllTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableAllTest.java @@ -19,7 +19,8 @@ // - 313401: shared-cache-mode defaults to NONE when the element value is unrecognized package org.eclipse.persistence.testing.tests.jpa.cacheable; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; /* * The test is testing against "ALL" persistence unit which has to be ALL diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableDisableSelectiveTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableDisableSelectiveTest.java index f513dca7297..59142283b27 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableDisableSelectiveTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableDisableSelectiveTest.java @@ -19,7 +19,8 @@ // - 313401: shared-cache-mode defaults to NONE when the element value is unrecognized package org.eclipse.persistence.testing.tests.jpa.cacheable; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; /* * The test is testing against "DISABLE_SELECTIVE" persistence unit which has to be DISABLE_SELECTIVE diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableNoneTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableNoneTest.java index 37f9ebd27b7..c4e6734bbc6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableNoneTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableNoneTest.java @@ -19,7 +19,8 @@ // - 313401: shared-cache-mode defaults to NONE when the element value is unrecognized package org.eclipse.persistence.testing.tests.jpa.cacheable; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; /* * The test is testing against "NONE" persistence unit which has to be NONE diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableUnspecifiedTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableUnspecifiedTest.java index f5850f32130..21fc8bc536d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableUnspecifiedTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cacheable/src/test/java/org/eclipse/persistence/testing/tests/jpa/cacheable/CacheableUnspecifiedTest.java @@ -19,7 +19,8 @@ // - 313401: shared-cache-mode defaults to NONE when the element value is unrecognized package org.eclipse.persistence.testing.tests.jpa.cacheable; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; /* * The test is testing against "UNSPECIFIED" persistence unit which has to be UNSPECIFIED diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchA.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchA.java index 455c2101b83..aace7840936 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchA.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchA.java @@ -12,16 +12,20 @@ package org.eclipse.persistence.testing.models.jpa.cascadedeletes; -import static jakarta.persistence.CascadeType.REMOVE; -import static jakarta.persistence.FetchType.LAZY; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import org.eclipse.persistence.annotations.PrivateOwned; import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import jakarta.persistence.*; - -import org.eclipse.persistence.annotations.PrivateOwned; +import static jakarta.persistence.CascadeType.REMOVE; +import static jakarta.persistence.FetchType.LAZY; /** * Entity implementation class for Entity: BranchA diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java index a31e71b0839..8bed2976e82 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/BranchB.java @@ -12,13 +12,6 @@ package org.eclipse.persistence.testing.models.jpa.cascadedeletes; -import static jakarta.persistence.CascadeType.REMOVE; -import static jakarta.persistence.FetchType.LAZY; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Entity; import jakarta.persistence.EntityManager; import jakarta.persistence.GeneratedValue; @@ -26,9 +19,15 @@ import jakarta.persistence.ManyToMany; import jakarta.persistence.OneToMany; import jakarta.persistence.OrderBy; - import org.eclipse.persistence.annotations.PrivateOwned; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.CascadeType.REMOVE; +import static jakarta.persistence.FetchType.LAZY; + @Entity public class BranchB implements Serializable, PersistentIdentity{ @Id diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/CascadeDeleteTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/CascadeDeleteTableCreator.java index 86a307fb473..a95b27d405a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/CascadeDeleteTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/CascadeDeleteTableCreator.java @@ -14,7 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.cascadedeletes; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.ForeignKeyConstraint; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class CascadeDeleteTableCreator extends org.eclipse.persistence.tools.schemaframework.TableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafA.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafA.java index e02c68a50f2..2798557835e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafA.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafA.java @@ -12,8 +12,14 @@ package org.eclipse.persistence.testing.models.jpa.cascadedeletes; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; + import java.io.Serializable; -import jakarta.persistence.*; /** * Entity implementation class for Entity: LeafA diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafB.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafB.java index 39ad8bdc02e..4167d9503d8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafB.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/LeafB.java @@ -12,8 +12,12 @@ package org.eclipse.persistence.testing.models.jpa.cascadedeletes; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; + import java.io.Serializable; -import jakarta.persistence.*; /** * Entity implementation class for Entity: LeafB diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/MachineState.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/MachineState.java index 1c3c342cefc..b23e393d90e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/MachineState.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/MachineState.java @@ -12,16 +12,15 @@ package org.eclipse.persistence.testing.models.jpa.cascadedeletes; -import static jakarta.persistence.CascadeType.ALL; - -import java.util.List; - import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.OneToMany; - import org.eclipse.persistence.annotations.PrivateOwned; +import java.util.List; + +import static jakarta.persistence.CascadeType.ALL; + @Entity public class MachineState { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/RootA.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/RootA.java index d810b4310ac..d40af5baa83 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/RootA.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/main/java/org/eclipse/persistence/testing/models/jpa/cascadedeletes/RootA.java @@ -12,16 +12,20 @@ package org.eclipse.persistence.testing.models.jpa.cascadedeletes; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import org.eclipse.persistence.annotations.PrivateOwned; + import java.io.Serializable; import java.util.ArrayList; import java.util.List; -import jakarta.persistence.*; - -import org.eclipse.persistence.annotations.PrivateOwned; - -import static jakarta.persistence.FetchType.LAZY; import static jakarta.persistence.CascadeType.REMOVE; +import static jakarta.persistence.FetchType.LAZY; /** * Entity implementation class for Entity: RootA diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/test/java/org/eclipse/persistence/testing/tests/jpa/cascadedeletes/CascadeDeletesTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/test/java/org/eclipse/persistence/testing/tests/jpa/cascadedeletes/CascadeDeletesTest.java index 129dcc50479..a8fb7629996 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/test/java/org/eclipse/persistence/testing/tests/jpa/cascadedeletes/CascadeDeletesTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.cascadedeletes/src/test/java/org/eclipse/persistence/testing/tests/jpa/cascadedeletes/CascadeDeletesTest.java @@ -15,13 +15,9 @@ package org.eclipse.persistence.testing.tests.jpa.cascadedeletes; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - import jakarta.persistence.EntityManager; - -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.cascadedeletes.BranchA; import org.eclipse.persistence.testing.models.jpa.cascadedeletes.BranchB; @@ -33,6 +29,10 @@ import org.eclipse.persistence.testing.models.jpa.cascadedeletes.RootA; import org.eclipse.persistence.testing.models.jpa.cascadedeletes.ThreadInfo; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + public class CascadeDeletesTest extends JUnitTestCase { public CascadeDeletesTest() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Heart.java b/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Heart.java index 13522c00bec..e175b920283 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Heart.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Heart.java @@ -18,6 +18,8 @@ import jakarta.persistence.Column; import jakarta.persistence.Embeddable; +import java.util.Objects; + @Embeddable public class Heart { @Column(name="H_SIZE") @@ -40,6 +42,11 @@ public boolean equals(Object objectToCompare) { return false; } + @Override + public int hashCode() { + return Objects.hash(size); + } + public int getSize() { return size; } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Torso.java b/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Torso.java index 89d53c18c32..44775bf94ee 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Torso.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.complexaggregate/src/main/java/org/eclipse/persistence/testing/models/jpa/complexaggregate/Torso.java @@ -20,6 +20,8 @@ import jakarta.persistence.Embedded; import jakarta.persistence.GeneratedValue; +import java.util.Objects; + @Embeddable public class Torso { @GeneratedValue @@ -46,6 +48,11 @@ public boolean equals(Object objectToCompare) { return false; } + @Override + public int hashCode() { + return Objects.hash(count, heart); + } + public Torso(int count, Heart heart) { this.count = count; this.heart = heart; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Address.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Address.java index 9a30c08e5a0..f4b033628d4 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Address.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Address.java @@ -14,22 +14,38 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1; -import java.util.*; -import java.io.Serializable; -import jakarta.persistence.*; - -import static jakarta.persistence.CascadeType.*; - +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.ColumnResult; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityResult; +import jakarta.persistence.FieldResult; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.NamedNativeQueries; +import jakarta.persistence.NamedNativeQuery; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToMany; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.SqlResultSetMapping; +import jakarta.persistence.SqlResultSetMappings; +import jakarta.persistence.Table; +import jakarta.persistence.Version; +import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.annotations.NamedStoredFunctionQuery; -import org.eclipse.persistence.annotations.NamedStoredProcedureQuery; import org.eclipse.persistence.annotations.NamedStoredProcedureQueries; +import org.eclipse.persistence.annotations.NamedStoredProcedureQuery; import org.eclipse.persistence.annotations.StoredProcedureParameter; -import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; +import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; + +import static jakarta.persistence.CascadeType.ALL; import static org.eclipse.persistence.annotations.Direction.IN; -import static org.eclipse.persistence.annotations.Direction.OUT; import static org.eclipse.persistence.annotations.Direction.IN_OUT; +import static org.eclipse.persistence.annotations.Direction.OUT; /** *

Purpose: Represents the mailing address on an Employee diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/AdvancedTableCreator_1.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/AdvancedTableCreator_1.java index 89e94fa6e1e..835cc90e634 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/AdvancedTableCreator_1.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/AdvancedTableCreator_1.java @@ -23,7 +23,8 @@ package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedTableCreator_1 extends TogglingFastTableCreator { public AdvancedTableCreator_1() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Customer.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Customer.java index ef276eb8a16..db3563294ae 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Customer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Customer.java @@ -14,8 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.Column; @@ -27,6 +25,8 @@ import jakarta.persistence.Transient; import jakarta.persistence.Version; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="AdvancedCustomer") @Access(value=AccessType.PROPERTY) @Table(name="MBR1_ADV_CUSTOMER") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Department.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Department.java index 2a517969e25..1f2740e1abd 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Department.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/Department.java @@ -16,16 +16,9 @@ // - 286317: UniqueConstraint xml element is changing (plus couple other fixes, see bug) package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1; -import java.io.Serializable; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Vector; - import jakarta.persistence.Entity; -import jakarta.persistence.Id; import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinTable; import jakarta.persistence.MapKey; @@ -34,16 +27,21 @@ import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; - -import static jakarta.persistence.CascadeType.PERSIST; -import static jakarta.persistence.GenerationType.TABLE; -import static org.eclipse.persistence.annotations.CacheType.SOFT_WEAK; - import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.annotations.PrivateOwned; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3.Equipment; +import java.io.Serializable; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Vector; + +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.GenerationType.TABLE; +import static org.eclipse.persistence.annotations.CacheType.SOFT_WEAK; + /** *

* Purpose: Represents the department of an Employee diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/EquipmentCode.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/EquipmentCode.java index b8f1ca9b3f0..77fe49d346a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/EquipmentCode.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/EquipmentCode.java @@ -17,15 +17,14 @@ import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; +import jakarta.persistence.NamedNativeQueries; +import jakarta.persistence.NamedNativeQuery; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; -import jakarta.persistence.NamedNativeQuery; -import jakarta.persistence.NamedNativeQueries; +import org.eclipse.persistence.annotations.ReadOnly; import static jakarta.persistence.GenerationType.TABLE; -import org.eclipse.persistence.annotations.ReadOnly; - @Entity @Table(name="MBR1_ADV_EQUIP_CODE") @ReadOnly diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/ReadOnlyIsolated.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/ReadOnlyIsolated.java index 6fbcc3f13b0..2cbc41d9cc3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/ReadOnlyIsolated.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_1/ReadOnlyIsolated.java @@ -17,7 +17,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.annotations.ReadOnly; import org.eclipse.persistence.config.CacheIsolationType; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedReadTransformer.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedReadTransformer.java index a88946b1ab0..63a4dcb7e8f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedReadTransformer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedReadTransformer.java @@ -14,13 +14,13 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; -import java.sql.Time; - import org.eclipse.persistence.mappings.foundation.AbstractTransformationMapping; import org.eclipse.persistence.mappings.transformers.AttributeTransformer; import org.eclipse.persistence.sessions.DataRecord; import org.eclipse.persistence.sessions.Session; +import java.sql.Time; + public class AdvancedReadTransformer implements AttributeTransformer { String attributeName; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedTableCreator_2.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedTableCreator_2.java index c73ea82a43e..d57dd224f03 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedTableCreator_2.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedTableCreator_2.java @@ -23,7 +23,8 @@ package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedTableCreator_2 extends TogglingFastTableCreator { public AdvancedTableCreator_2() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedWriteTransformer.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedWriteTransformer.java index 543abbc8ff9..df436c31b49 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedWriteTransformer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/AdvancedWriteTransformer.java @@ -14,12 +14,12 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; -import java.sql.Time; - import org.eclipse.persistence.mappings.foundation.AbstractTransformationMapping; import org.eclipse.persistence.mappings.transformers.FieldTransformer; import org.eclipse.persistence.sessions.Session; +import java.sql.Time; + public class AdvancedWriteTransformer implements FieldTransformer { String attributeName; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/Employee.java index 895138b62ca..de7c71c9437 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/Employee.java @@ -15,16 +15,39 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; -import java.sql.Time; -import java.util.*; -import java.io.Serializable; -import jakarta.persistence.*; - +import jakarta.persistence.AttributeOverride; +import jakarta.persistence.AttributeOverrides; +import jakarta.persistence.CollectionTable; +import jakarta.persistence.Column; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.NamedNativeQuery; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.persistence.PrimaryKeyJoinColumn; +import jakarta.persistence.QueryHint; +import jakarta.persistence.SecondaryTable; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Transient; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.annotations.ChangeTracking; import org.eclipse.persistence.annotations.CompositeMember; -import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.annotations.ConversionValue; +import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.annotations.Customizer; import org.eclipse.persistence.annotations.ExistenceChecking; import org.eclipse.persistence.annotations.IdValidation; @@ -33,8 +56,8 @@ import org.eclipse.persistence.annotations.OptimisticLocking; import org.eclipse.persistence.annotations.PrimaryKey; import org.eclipse.persistence.annotations.PrivateOwned; -import org.eclipse.persistence.annotations.Property; import org.eclipse.persistence.annotations.Properties; +import org.eclipse.persistence.annotations.Property; import org.eclipse.persistence.annotations.ReadTransformer; import org.eclipse.persistence.annotations.TypeConverter; import org.eclipse.persistence.annotations.WriteTransformer; @@ -50,10 +73,21 @@ import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3.Project; -import static jakarta.persistence.CascadeType.*; -import static jakarta.persistence.FetchType.*; -import static jakarta.persistence.GenerationType.*; - +import java.io.Serializable; +import java.sql.Time; +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumSet; +import java.util.List; +import java.util.Set; +import java.util.Vector; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.CascadeType.MERGE; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.FetchType.LAZY; +import static jakarta.persistence.GenerationType.TABLE; import static org.eclipse.persistence.annotations.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS; import static org.eclipse.persistence.annotations.CacheType.SOFT_WEAK; import static org.eclipse.persistence.annotations.ChangeTrackingType.AUTO; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmployeeListener.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmployeeListener.java index 7ecb8b3315e..5be683c1339 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmployeeListener.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmployeeListener.java @@ -16,7 +16,13 @@ package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; -import jakarta.persistence.*; +import jakarta.persistence.PostLoad; +import jakarta.persistence.PostPersist; +import jakarta.persistence.PostRemove; +import jakarta.persistence.PostUpdate; +import jakarta.persistence.PrePersist; +import jakarta.persistence.PreRemove; +import jakarta.persistence.PreUpdate; import java.sql.Date; import java.util.EventListener; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmploymentPeriod.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmploymentPeriod.java index 67ea1babcda..e5877a04aca 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmploymentPeriod.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/EmploymentPeriod.java @@ -14,14 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import org.eclipse.persistence.annotations.Property; + +import java.io.Serializable; import java.sql.Date; -import java.io.*; import java.util.Objects; -import jakarta.persistence.*; - -import org.eclipse.persistence.annotations.Property; - /** *

Purpose: Defines the period an Employee worked for the organization *

Description: The period holds the start date and optionally the diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/FormerEmployment.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/FormerEmployment.java index 214b2f96199..144e6142947 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/FormerEmployment.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_2/FormerEmployment.java @@ -14,8 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2; -import java.io.*; -import jakarta.persistence.*; +import jakarta.persistence.Basic; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Embedded; + +import java.io.Serializable; /** *

Purpose: Defines the former employment of an Employee. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/AdvancedTableCreator_3.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/AdvancedTableCreator_3.java index 14721044b38..ecd47902258 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/AdvancedTableCreator_3.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/AdvancedTableCreator_3.java @@ -23,7 +23,8 @@ package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedTableCreator_3 extends TogglingFastTableCreator { public AdvancedTableCreator_3() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Dealer.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Dealer.java index 6a82f3d1625..c0484344a61 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Dealer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Dealer.java @@ -14,13 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; -import static jakarta.persistence.CascadeType.MERGE; -import static jakarta.persistence.CascadeType.PERSIST; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -30,9 +23,15 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; - import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1.Customer; +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.CascadeType.MERGE; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="MBR3_DEALER") public class Dealer { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Equipment.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Equipment.java index c40a03ca8c5..f68c30d4d8d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Equipment.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Equipment.java @@ -23,7 +23,6 @@ import jakarta.persistence.NamedNativeQuery; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; - import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1.Department; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_1.EquipmentCode; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/HugeProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/HugeProject.java index a8be13f1ab4..a13d780a1ad 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/HugeProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/HugeProject.java @@ -14,8 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; -import jakarta.persistence.*; - +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; import static jakarta.persistence.FetchType.LAZY; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/LargeProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/LargeProject.java index 4f8b691954f..95b00f46a4a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/LargeProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/LargeProject.java @@ -14,8 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; -import jakarta.persistence.*; - +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.ExistenceChecking; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/PhoneNumber.java index 13386da103f..bc898c1f4ee 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/PhoneNumber.java @@ -14,17 +14,27 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; -import java.io.*; +import jakarta.persistence.CollectionTable; +import jakarta.persistence.Column; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.persistence.Enumerated; +import jakarta.persistence.Id; +import jakarta.persistence.IdClass; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import org.eclipse.persistence.annotations.CompositeMember; +import org.eclipse.persistence.queries.FetchGroupTracker; +import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; + +import java.io.Serializable; +import java.io.StringWriter; import java.util.Collection; import java.util.Vector; -import jakarta.persistence.*; import static jakarta.persistence.EnumType.STRING; -import org.eclipse.persistence.annotations.CompositeMember; -import org.eclipse.persistence.queries.FetchGroupTracker; -import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; - /** *

Purpose: Describes an Employee's phone number. *

Description: Used in a 1:M relationship from an employee. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Project.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Project.java index 137c2666588..58fd1bfdb24 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Project.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/Project.java @@ -14,17 +14,45 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; -import java.util.*; -import java.io.Serializable; -import jakarta.persistence.*; -import static org.eclipse.persistence.annotations.ExistenceType.CHECK_CACHE; -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.InheritanceType.*; - +import jakarta.persistence.CascadeType; +import jakarta.persistence.CollectionTable; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Inheritance; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToOne; +import jakarta.persistence.PostLoad; +import jakarta.persistence.PostPersist; +import jakarta.persistence.PostRemove; +import jakarta.persistence.PostUpdate; +import jakarta.persistence.PrePersist; +import jakarta.persistence.PreRemove; +import jakarta.persistence.PreUpdate; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.CompositeMember; import org.eclipse.persistence.annotations.ExistenceChecking; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_2.Employee; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Vector; + +import static jakarta.persistence.GenerationType.SEQUENCE; +import static jakarta.persistence.InheritanceType.JOINED; +import static org.eclipse.persistence.annotations.ExistenceType.CHECK_CACHE; + /** * Employees have a many-to-many relationship with Projects through the * projects attribute. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/SmallProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/SmallProject.java index 6985e065e92..cfeff777b37 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/SmallProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/member_3/SmallProject.java @@ -14,8 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3; -import jakarta.persistence.*; - +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.ExistenceChecking; import static org.eclipse.persistence.annotations.ExistenceType.ASSUME_EXISTENCE; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/Customizer.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/Customizer.java index 31487ceb470..643a0bc2920 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/Customizer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/Customizer.java @@ -14,9 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.composite.advanced; -import java.util.HashMap; -import java.util.Map; - import org.eclipse.persistence.config.DescriptorCustomizer; import org.eclipse.persistence.config.SessionCustomizer; import org.eclipse.persistence.descriptors.ClassDescriptor; @@ -34,6 +31,9 @@ import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3.LargeProject; import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3.Project; +import java.util.HashMap; +import java.util.Map; + /** * Session and descriptor customizer. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/EmployeePopulator.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/EmployeePopulator.java index af1424d71c7..78d18c37466 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/EmployeePopulator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/main/java/org/eclipse/persistence/testing/models/jpa/composite/advanced/EmployeePopulator.java @@ -16,8 +16,6 @@ // - 260263: SQLServer 2005/2008 requires stored procedure creation select clause variable and column name matching package org.eclipse.persistence.testing.models.jpa.composite.advanced; -import java.util.*; - import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.UnitOfWork; @@ -35,6 +33,9 @@ import org.eclipse.persistence.tools.schemaframework.SchemaManager; import org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition; +import java.util.Calendar; +import java.util.Vector; + /** *

Purpose: To build and populate the database for example and testing purposes. * This population routine is fairly complex and makes use of the population manager to @@ -1448,7 +1449,7 @@ protected Vector getAllObjects() { return populationManager.getAllObjects(); } - public Vector getAllObjectsForClass(Class domainClass) { + public Vector getAllObjectsForClass(Class domainClass) { return populationManager.getAllObjectsForClass(domainClass); } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java index e469aad463b..3a254643526 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTest.java @@ -31,26 +31,6 @@ // - 489787: Add negative test for non-entity supplied to PersistenceUnitUtil.isLoaded package org.eclipse.persistence.testing.tests.jpa.composite.advanced; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.StringWriter; -import java.sql.Date; -import java.sql.Time; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Collections; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Vector; - import jakarta.persistence.EntityExistsException; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; @@ -69,7 +49,8 @@ import jakarta.persistence.TypedQuery; import jakarta.persistence.spi.LoadState; import jakarta.persistence.spi.ProviderUtil; - +import junit.framework.AssertionFailedError; +import junit.framework.TestSuite; import org.eclipse.persistence.config.CacheUsage; import org.eclipse.persistence.config.CacheUsageIndirectionPolicy; import org.eclipse.persistence.config.CascadePolicy; @@ -180,10 +161,27 @@ import org.eclipse.persistence.testing.models.jpa.composite.advanced.member_3.SuperLargeProject; import org.eclipse.persistence.tools.schemaframework.SequenceObjectDefinition; import org.eclipse.persistence.tools.schemaframework.TableCreator; - import org.junit.Assert; -import junit.framework.AssertionFailedError; -import junit.framework.TestSuite; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.StringWriter; +import java.sql.Date; +import java.sql.Time; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Collection; +import java.util.Collections; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; /** * Test the EntityManager API using the advanced model. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.datatypes/src/test/java/org/eclipse/persistence/testing/tests/jpa/datatypes/arraypks/PrimitiveArrayPKCachingTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.datatypes/src/test/java/org/eclipse/persistence/testing/tests/jpa/datatypes/arraypks/PrimitiveArrayPKCachingTest.java index fbbb261b1bb..1b8c1a4974a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.datatypes/src/test/java/org/eclipse/persistence/testing/tests/jpa/datatypes/arraypks/PrimitiveArrayPKCachingTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.datatypes/src/test/java/org/eclipse/persistence/testing/tests/jpa/datatypes/arraypks/PrimitiveArrayPKCachingTest.java @@ -15,7 +15,6 @@ package org.eclipse.persistence.testing.tests.jpa.datatypes.arraypks; import jakarta.persistence.EntityManager; -import junit.extensions.TestSetup; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.persistence.sessions.server.ServerSession; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTime.java b/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTime.java index c03255250ff..5093d47fbfa 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTime.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTime.java @@ -17,7 +17,16 @@ // - 375101: Date and Calendar should not require @Temporal. package org.eclipse.persistence.testing.models.jpa.datetime; -import static jakarta.persistence.GenerationType.TABLE; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; import java.io.Serializable; import java.sql.Time; @@ -33,16 +42,7 @@ import java.util.HashMap; import java.util.Map; -import jakarta.persistence.CascadeType; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Id; -import jakarta.persistence.OneToMany; -import jakarta.persistence.Table; -import jakarta.persistence.TableGenerator; -import jakarta.persistence.Temporal; -import jakarta.persistence.TemporalType; +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name = "CMP3_DATE_TIME") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTimePopulator.java b/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTimePopulator.java index ea398029971..b01fc273ac1 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTimePopulator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/main/java/org/eclipse/persistence/testing/models/jpa/datetime/DateTimePopulator.java @@ -14,6 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.datetime; +import org.eclipse.persistence.internal.helper.Helper; +import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; +import org.eclipse.persistence.sessions.Session; +import org.eclipse.persistence.sessions.UnitOfWork; + import java.lang.reflect.Method; import java.sql.Time; import java.sql.Timestamp; @@ -25,11 +30,6 @@ import java.util.GregorianCalendar; import java.util.Vector; -import org.eclipse.persistence.internal.helper.Helper; -import org.eclipse.persistence.internal.security.PrivilegedAccessHelper; -import org.eclipse.persistence.sessions.Session; -import org.eclipse.persistence.sessions.UnitOfWork; - public class DateTimePopulator { public DateTimePopulator() { } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/test/java/org/eclipse/persistence/testing/tests/jpa/datetime/NullBindingTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/test/java/org/eclipse/persistence/testing/tests/jpa/datetime/NullBindingTest.java index c979fae027c..be8e95d9886 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/test/java/org/eclipse/persistence/testing/tests/jpa/datetime/NullBindingTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.datetime/src/test/java/org/eclipse/persistence/testing/tests/jpa/datetime/NullBindingTest.java @@ -17,18 +17,16 @@ // - 375101: Date and Calendar should not require @Temporal. package org.eclipse.persistence.testing.tests.jpa.datetime; -import java.util.Date; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.datetime.DateTime; import org.eclipse.persistence.testing.models.jpa.datetime.DateTimeTableCreator; -import junit.framework.Test; -import junit.framework.TestSuite; +import java.util.Date; +import java.util.Map; /** *

diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/ContactInfo.java b/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/ContactInfo.java index 3ba723b2f23..be2f3079fa3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/ContactInfo.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/ContactInfo.java @@ -39,7 +39,7 @@ public class ContactInfo { // Uni-directional M-M @ManyToMany(cascade=PERSIST, fetch=EAGER) @JoinTable(name="DDL_EMP_COMMENTS") - public List comments; + public List> comments; // Direct collection @ElementCollection @@ -52,7 +52,7 @@ public ContactInfo() { updates = new ArrayList<>(); } - public void addComment(Comment comment) { + public void addComment(Comment comment) { comments.add(comment); } @@ -64,7 +64,7 @@ public void addUpdate(String update) { updates.add(update); } - public List getComments() { + public List> getComments() { return comments; } @@ -76,7 +76,7 @@ public List getUpdates() { return updates; } - public void setComments(List comments) { + public void setComments(List> comments) { this.comments = comments; } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/Employee.java index 725eaae221e..b2c270cd060 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.ddlgeneration/src/main/java/org/eclipse/persistence/testing/models/jpa/ddlgeneration/Employee.java @@ -69,7 +69,7 @@ public Employee() {} @Column(table="DDL_SALARY") private Integer salary; - public void addComment(Comment comment) { + public void addComment(Comment comment) { getContactInfo().addComment(comment); } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Address.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Address.java index bc2a05808d7..80384e2f152 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Address.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Address.java @@ -14,11 +14,23 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import java.util.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.NamedNativeQueries; +import jakarta.persistence.NamedNativeQuery; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToMany; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import jakarta.persistence.Version; + import java.io.Serializable; -import jakarta.persistence.*; +import java.util.Collection; +import java.util.Vector; -import static jakarta.persistence.CascadeType.*; +import static jakarta.persistence.CascadeType.ALL; /** *

Purpose: Represents the mailing address on an Employee diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Employee.java index e2be78a1966..bf3b606e328 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Employee.java @@ -14,20 +14,6 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.CascadeType.MERGE; -import static jakarta.persistence.CascadeType.PERSIST; -import static jakarta.persistence.FetchType.LAZY; -import static jakarta.persistence.GenerationType.TABLE; -import static org.eclipse.persistence.annotations.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS; -import static org.eclipse.persistence.annotations.CacheType.SOFT_WEAK; -import static org.eclipse.persistence.annotations.ExistenceType.CHECK_DATABASE; -import static org.eclipse.persistence.annotations.OptimisticLockingType.VERSION_COLUMN; - -import java.io.Serializable; -import java.util.Collection; -import java.util.Vector; - import jakarta.persistence.AttributeOverride; import jakarta.persistence.AttributeOverrides; import jakarta.persistence.Column; @@ -46,7 +32,6 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; - import org.eclipse.persistence.annotations.BasicCollection; import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.annotations.ChangeTracking; @@ -62,6 +47,20 @@ import org.eclipse.persistence.annotations.TypeConverter; import org.eclipse.persistence.config.CacheIsolationType; +import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.CascadeType.MERGE; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.FetchType.LAZY; +import static jakarta.persistence.GenerationType.TABLE; +import static org.eclipse.persistence.annotations.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS; +import static org.eclipse.persistence.annotations.CacheType.SOFT_WEAK; +import static org.eclipse.persistence.annotations.ExistenceType.CHECK_DATABASE; +import static org.eclipse.persistence.annotations.OptimisticLockingType.VERSION_COLUMN; + /** * Employees have a one-to-many relationship with Employees through the * managedEmployees attribute. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/EmploymentPeriod.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/EmploymentPeriod.java index 661e7de3e25..c23bb0e549e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/EmploymentPeriod.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/EmploymentPeriod.java @@ -14,12 +14,14 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import java.sql.Date; -import java.io.*; -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.Property; +import java.io.Serializable; +import java.sql.Date; + /** *

Purpose: Defines the period an Employee worked for the organization *

Description: The period holds the start date and optionally the diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/LargeProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/LargeProject.java index 294e6087bfb..96e2e0937d6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/LargeProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/LargeProject.java @@ -14,8 +14,11 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import jakarta.persistence.*; - +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.ExistenceChecking; import static org.eclipse.persistence.annotations.ExistenceType.ASSUME_NON_EXISTENCE; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/PhoneNumber.java index 8aac3b08a39..dcca183fa6b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/PhoneNumber.java @@ -14,7 +14,8 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import java.io.*; +import java.io.Serializable; +import java.io.StringWriter; /** *

Purpose: Describes an Employee's phone number. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Project.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Project.java index 46d63ccbe09..10bf2a5a4e3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Project.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/Project.java @@ -14,17 +14,42 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import java.util.*; -import java.io.Serializable; -import jakarta.persistence.*; -import static org.eclipse.persistence.annotations.ExistenceType.CHECK_CACHE; -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.InheritanceType.*; - +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Inheritance; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToOne; +import jakarta.persistence.PostLoad; +import jakarta.persistence.PostPersist; +import jakarta.persistence.PostRemove; +import jakarta.persistence.PostUpdate; +import jakarta.persistence.PrePersist; +import jakarta.persistence.PreRemove; +import jakarta.persistence.PreUpdate; +import jakarta.persistence.SequenceGenerator; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.BasicCollection; import org.eclipse.persistence.annotations.CollectionTable; import org.eclipse.persistence.annotations.ExistenceChecking; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Vector; + +import static jakarta.persistence.GenerationType.SEQUENCE; +import static jakarta.persistence.InheritanceType.JOINED; +import static org.eclipse.persistence.annotations.ExistenceType.CHECK_CACHE; + /** * Employees have a many-to-many relationship with Projects through the * projects attribute. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SimpleImage.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SimpleImage.java index 1aa1447404f..fcb7aa312da 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SimpleImage.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SimpleImage.java @@ -15,8 +15,6 @@ // - bug 338585: Issue while inserting blobs with delimited identifiers on Oracle Database package org.eclipse.persistence.testing.models.jpa.delimited; -import java.io.Serializable; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -24,6 +22,8 @@ import jakarta.persistence.Lob; import jakarta.persistence.Table; +import java.io.Serializable; + /** * @author cdelahun * diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SmallProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SmallProject.java index 99eccd9874f..c8cde9402a4 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SmallProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/main/java/org/eclipse/persistence/testing/models/jpa/delimited/SmallProject.java @@ -14,8 +14,9 @@ // tware - add for testing JPA 2.0 delimited identifiers package org.eclipse.persistence.testing.models.jpa.delimited; -import jakarta.persistence.*; - +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.ExistenceChecking; import static org.eclipse.persistence.annotations.ExistenceType.ASSUME_EXISTENCE; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/test/java/org/eclipse/persistence/testing/tests/jpa/delimited/DelimitedPUTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/test/java/org/eclipse/persistence/testing/tests/jpa/delimited/DelimitedPUTest.java index 6fb7bc7ffe6..b0c23a35cd5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/test/java/org/eclipse/persistence/testing/tests/jpa/delimited/DelimitedPUTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.delimited/src/test/java/org/eclipse/persistence/testing/tests/jpa/delimited/DelimitedPUTest.java @@ -17,19 +17,23 @@ package org.eclipse.persistence.testing.tests.jpa.delimited; -import java.sql.Date; -import java.util.List; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - -import org.junit.Assert; import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.internal.databaseaccess.DatabasePlatform; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.delimited.*; +import org.eclipse.persistence.testing.models.jpa.delimited.Address; +import org.eclipse.persistence.testing.models.jpa.delimited.Employee; +import org.eclipse.persistence.testing.models.jpa.delimited.EmploymentPeriod; +import org.eclipse.persistence.testing.models.jpa.delimited.LargeProject; +import org.eclipse.persistence.testing.models.jpa.delimited.PhoneNumber; +import org.eclipse.persistence.testing.models.jpa.delimited.SimpleImage; +import org.eclipse.persistence.testing.models.jpa.delimited.SmallProject; +import org.junit.Assert; + +import java.sql.Date; +import java.util.List; /** * Test the EntityManager API using a model that uses delimited-identifiers diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Address.java b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Address.java index 967d7b3d150..2704b49f182 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Address.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Address.java @@ -14,17 +14,16 @@ // tware - initial implementation as part of extensibility feature package org.eclipse.persistence.testing.models.jpa.extensibility; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.VirtualAccessMethods; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + @Entity(name="ExtensibilityAddress") @Table(name="EXTENS_ADDR") @VirtualAccessMethods diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Employee.java index 0ea1422e801..b854c2eac12 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/Employee.java @@ -14,21 +14,20 @@ // tware - initial implementation as part of extensibility feature package org.eclipse.persistence.testing.models.jpa.extensibility; -import java.util.HashMap; -import java.util.Map; - import jakarta.persistence.CascadeType; import jakarta.persistence.Entity; import jakarta.persistence.FetchType; -import jakarta.persistence.ManyToOne; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import jakarta.persistence.Transient; import jakarta.persistence.Version; - import org.eclipse.persistence.annotations.VirtualAccessMethods; +import java.util.HashMap; +import java.util.Map; + @Entity(name="ExtensibilityEmployee") @Table(name="EXTENS_EMP") @VirtualAccessMethods(get="getExt", set="putExt") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/ExtensibilityTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/ExtensibilityTableCreator.java index 07e3e7bd397..954f84c0ca7 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/ExtensibilityTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/ExtensibilityTableCreator.java @@ -15,7 +15,6 @@ package org.eclipse.persistence.testing.models.jpa.extensibility; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -//import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; import org.eclipse.persistence.tools.schemaframework.FieldDefinition; import org.eclipse.persistence.tools.schemaframework.TableCreator; import org.eclipse.persistence.tools.schemaframework.TableDefinition; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/PhoneNumber.java index e002ffa3350..451f51d9427 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/main/java/org/eclipse/persistence/testing/models/jpa/extensibility/PhoneNumber.java @@ -14,11 +14,16 @@ // tware - initial implementation as part of extensibility feature package org.eclipse.persistence.testing.models.jpa.extensibility; -import java.io.*; - -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.queries.FetchGroupTracker; + +import java.io.Serializable; +import java.io.StringWriter; /** *

Purpose: Describes an Employee's phone number. *

Description: Used in a 1:M relationship from an employee. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/test/java/org/eclipse/persistence/testing/tests/jpa/extensibility/ExtensibilityTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/test/java/org/eclipse/persistence/testing/tests/jpa/extensibility/ExtensibilityTests.java index f2c67a400bf..9b56cb6618f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/test/java/org/eclipse/persistence/testing/tests/jpa/extensibility/ExtensibilityTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.extensibility/src/test/java/org/eclipse/persistence/testing/tests/jpa/extensibility/ExtensibilityTests.java @@ -14,28 +14,11 @@ // tware - initial implementation as part of extensibility feature package org.eclipse.persistence.testing.tests.jpa.extensibility; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.PersistenceException; - import junit.framework.Test; import junit.framework.TestSuite; - -import org.eclipse.persistence.queries.FetchGroup; -import org.eclipse.persistence.sessions.Connector; -import org.eclipse.persistence.sessions.DatabaseLogin; -import org.eclipse.persistence.sessions.JNDIConnector; -import org.eclipse.persistence.sessions.server.ServerSession; -import org.eclipse.persistence.testing.models.jpa.extensibility.Employee; -import org.eclipse.persistence.testing.models.jpa.extensibility.Address; -import org.eclipse.persistence.testing.models.jpa.extensibility.PhoneNumber; - import org.eclipse.persistence.config.PersistenceUnitProperties; import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.descriptors.RelationalDescriptor; @@ -43,13 +26,27 @@ import org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate; import org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider; import org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl; -import org.eclipse.persistence.internal.sessions.coordination.MetadataRefreshCommand; import org.eclipse.persistence.internal.sessions.AbstractSession; +import org.eclipse.persistence.internal.sessions.coordination.MetadataRefreshCommand; import org.eclipse.persistence.jpa.JpaEntityManager; -import org.eclipse.persistence.jpa.JpaHelper; import org.eclipse.persistence.jpa.JpaEntityManagerFactory; +import org.eclipse.persistence.jpa.JpaHelper; +import org.eclipse.persistence.queries.FetchGroup; +import org.eclipse.persistence.sessions.Connector; +import org.eclipse.persistence.sessions.DatabaseLogin; +import org.eclipse.persistence.sessions.JNDIConnector; +import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.extensibility.Address; +import org.eclipse.persistence.testing.models.jpa.extensibility.Employee; import org.eclipse.persistence.testing.models.jpa.extensibility.ExtensibilityTableCreator; +import org.eclipse.persistence.testing.models.jpa.extensibility.PhoneNumber; + +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class ExtensibilityTests extends JUnitTestCase { @@ -273,7 +270,7 @@ public void testSimpleRefresh(){ Map properties = new HashMap<>(); properties.put(PersistenceUnitProperties.METADATA_SOURCE_XML_FILE, "extension2.xml"); - JpaHelper.getEntityManagerFactory(em).refreshMetadata(properties); + emf.unwrap(JpaEntityManagerFactory.class).refreshMetadata(properties); session = (ServerSession)getDatabaseSession(); addDescriptor = (RelationalDescriptor)session.getProject().getDescriptor(Address.class); @@ -296,15 +293,15 @@ public void testSimpleRefresh(){ emp = em.find(Employee.class, emp.getId()); assertEquals("111", emp.getAddress().get("appartmentNumber")); + System.gc(); + assertNotSame(emfRef.get(), JpaHelper.getEntityManagerFactory(em).unwrap()); } finally { if (isTransactionActive(em)) { rollbackTransaction(em); } - em.close(); + closeEntityManager(em); deleteEmployeeData(emf); } - System.gc(); - assertNull(emfRef.get()); } public void testMergeRefreshed(){ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java index b4826f11400..6f913737782 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/QuerySQLTracker.java @@ -22,12 +22,7 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess; //javase imports -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -//EclipseLink imports import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.logging.DefaultSessionLog; @@ -39,6 +34,11 @@ import org.eclipse.persistence.sessions.SessionEvent; import org.eclipse.persistence.sessions.SessionEventAdapter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + /** * * @author dclarke diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJPAJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJPAJunitTest.java index 040591d2d1b..586ac4b77d5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJPAJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJPAJunitTest.java @@ -20,17 +20,17 @@ // - 307547: Exception in order by clause after migrating to eclipselink 1.2 release package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.Collection; - -import jakarta.persistence.*; - -import junit.framework.*; - +import jakarta.persistence.EntityManager; +import jakarta.persistence.LockModeType; +import jakarta.persistence.PersistenceException; +import jakarta.persistence.PessimisticLockException; +import jakarta.persistence.Query; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.descriptors.ClassDescriptor; -import org.eclipse.persistence.sessions.server.ServerSession; -import org.eclipse.persistence.mappings.ForeignReferenceMapping; import org.eclipse.persistence.internal.jpa.EJBQueryImpl; - +import org.eclipse.persistence.mappings.ForeignReferenceMapping; +import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; @@ -39,11 +39,13 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Equipment; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.EquipmentCode; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.GoldBuyer; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.LargeProject; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.SmallProject; +import java.util.Collection; + /** * This test suite tests EclipseLink JPA annotations extensions. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJunitTest.java index 5359207bf4f..5e079e22ba8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/AdvancedJunitTest.java @@ -14,30 +14,25 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.Arrays; - import jakarta.persistence.EntityManager; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.jpa.JpaEntityManager; import org.eclipse.persistence.sessions.CopyGroup; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Child; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Man; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Parent; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Woman; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Golfer; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.GolferPK; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Man; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Parent; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PartnerLink; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Vegetable; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.VegetablePK; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Woman; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.WorldRank; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PartnerLink; import org.junit.Assert; public class AdvancedJunitTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/CallbackEventJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/CallbackEventJUnitTest.java index 9fa0aa6b0fa..7bd0a7b4e33 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/CallbackEventJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/CallbackEventJUnitTest.java @@ -14,17 +14,15 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.Vector; - import jakarta.persistence.EntityManager; - -import junit.framework.TestSuite; import junit.framework.Test; - +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.EmployeeListener; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; + +import java.util.Vector; /** * Suite used to contain Entity callback tests. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EmployeePopulator.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EmployeePopulator.java index ff12751c03d..67e37372204 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EmployeePopulator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EmployeePopulator.java @@ -14,8 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.*; - import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.UnitOfWork; @@ -35,6 +33,9 @@ import org.eclipse.persistence.tools.schemaframework.SchemaManager; import org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition; +import java.util.Calendar; +import java.util.Vector; + /** *

Purpose: To build and populate the database for example and testing purposes. * This population routine is fairly complex and makes use of the population manager to @@ -661,7 +662,6 @@ public SmallProject basicSmallProjectExample1() { } catch (Exception exception) { throw new RuntimeException(exception.toString()); } - ; return smallProject; } @@ -945,7 +945,7 @@ public StoredProcedureDefinition buildOracleStoredProcedureReadInOut(DatabaseSes public void persistExample(Session session) { - Vector allObjects = new Vector(); + Vector allObjects = new Vector<>(); UnitOfWork unitOfWork = session.acquireUnitOfWork(); // Disable the read-only classes for model population. Specifically, // in this case we want to be able to create EquipmentCode objects. @@ -1416,11 +1416,11 @@ public EquipmentCode equipmentCodeC() { return equipmentCode; } - protected Vector getAllObjects() { + protected Vector getAllObjects() { return populationManager.getAllObjects(); } - public Vector getAllObjectsForClass(Class domainClass) { + public Vector getAllObjectsForClass(Class domainClass) { return populationManager.getAllObjectsForClass(domainClass); } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java index 907c72ea15e..7549dc5cf48 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerJUnitTest.java @@ -17,23 +17,6 @@ // 304650: fix left over entity data interfering with testSetRollbackOnly package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.StringWriter; -import java.sql.Date; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Vector; - import jakarta.persistence.EntityExistsException; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; @@ -46,7 +29,9 @@ import jakarta.persistence.Query; import jakarta.persistence.RollbackException; import jakarta.persistence.TransactionRequiredException; - +import junit.framework.AssertionFailedError; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.config.CacheUsage; import org.eclipse.persistence.config.CascadePolicy; import org.eclipse.persistence.config.PersistenceUnitProperties; @@ -124,11 +109,24 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Woman; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.WorldRank; import org.eclipse.persistence.tools.schemaframework.SequenceObjectDefinition; - import org.junit.Assert; -import junit.framework.AssertionFailedError; -import junit.framework.Test; -import junit.framework.TestSuite; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.StringWriter; +import java.sql.Date; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Vector; /** * Test the EntityManager API using the advanced model. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java index 3e67ca2d65a..bfee727c8e5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/EntityManagerTLRJUnitTest.java @@ -16,72 +16,93 @@ // 304650: fix left over entity data interfering with testSetRollbackOnly package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.StringWriter; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Collection; -import java.util.Vector; -import java.util.Iterator; - import jakarta.persistence.EntityExistsException; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.EntityNotFoundException; import jakarta.persistence.FlushModeType; -import jakarta.persistence.Persistence; -import jakarta.persistence.Query; -import jakarta.persistence.TransactionRequiredException; import jakarta.persistence.LockModeType; -import jakarta.persistence.PersistenceException; import jakarta.persistence.OptimisticLockException; +import jakarta.persistence.Persistence; +import jakarta.persistence.PersistenceException; +import jakarta.persistence.Query; import jakarta.persistence.RollbackException; - +import jakarta.persistence.TransactionRequiredException; import junit.framework.AssertionFailedError; import junit.framework.Test; import junit.framework.TestSuite; -import org.eclipse.persistence.jpa.JpaQuery; -import org.eclipse.persistence.jpa.JpaEntityManager; -import org.eclipse.persistence.logging.SessionLog; -import org.eclipse.persistence.queries.DatabaseQuery; -import org.eclipse.persistence.internal.jpa.EJBQueryImpl; -import org.eclipse.persistence.internal.helper.Helper; -import org.eclipse.persistence.queries.ObjectLevelReadQuery; -import org.eclipse.persistence.queries.ReadAllQuery; -import org.eclipse.persistence.sessions.server.ReadConnectionPool; -import org.eclipse.persistence.sessions.server.ServerSession; -import org.eclipse.persistence.exceptions.ValidationException; -import org.eclipse.persistence.tools.schemaframework.SequenceObjectDefinition; -import org.eclipse.persistence.exceptions.QueryException; -import org.eclipse.persistence.expressions.Expression; -import org.eclipse.persistence.expressions.ExpressionBuilder; -import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.config.CacheUsage; import org.eclipse.persistence.config.CascadePolicy; -import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.config.PersistenceUnitProperties; import org.eclipse.persistence.config.PessimisticLock; +import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.descriptors.InheritancePolicy; import org.eclipse.persistence.descriptors.changetracking.ChangeTracker; +import org.eclipse.persistence.exceptions.QueryException; +import org.eclipse.persistence.exceptions.ValidationException; +import org.eclipse.persistence.expressions.Expression; +import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.internal.descriptors.PersistenceEntity; +import org.eclipse.persistence.internal.helper.Helper; +import org.eclipse.persistence.internal.jpa.EJBQueryImpl; import org.eclipse.persistence.internal.weaving.PersistenceWeaved; import org.eclipse.persistence.internal.weaving.PersistenceWeavedLazy; +import org.eclipse.persistence.jpa.JpaEntityManager; +import org.eclipse.persistence.jpa.JpaQuery; +import org.eclipse.persistence.logging.SessionLog; +import org.eclipse.persistence.logging.SessionLogEntry; +import org.eclipse.persistence.queries.DatabaseQuery; import org.eclipse.persistence.queries.FetchGroupTracker; +import org.eclipse.persistence.queries.ObjectLevelReadQuery; +import org.eclipse.persistence.queries.ReadAllQuery; import org.eclipse.persistence.sequencing.NativeSequence; import org.eclipse.persistence.sequencing.Sequence; -import org.eclipse.persistence.logging.SessionLogEntry; - +import org.eclipse.persistence.sessions.Session; +import org.eclipse.persistence.sessions.server.ReadConnectionPool; +import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.*; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Customizer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Department; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.EmploymentPeriod; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Equipment; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.EquipmentCode; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.FormerEmployment; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.GoldBuyer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Golfer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.GolferPK; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.LargeProject; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Man; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PartnerLink; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PlatinumBuyer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.SmallProject; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.SuperLargeProject; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Vegetable; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.VegetablePK; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Woman; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.WorldRank; +import org.eclipse.persistence.tools.schemaframework.SequenceObjectDefinition; import org.junit.Assert; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; + /** * Test the EntityManager API using the advanced model. */ @@ -95,6 +116,11 @@ public EntityManagerTLRJUnitTest(String name) { super(name); } + @Override + public String getPersistenceUnitName() { + return "fieldaccess"; + } + public static Test suite() { TestSuite suite = new TestSuite(); suite.setName("EntityManagerTLRJUnitTest (fieldaccess)"); @@ -219,17 +245,18 @@ public static Test suite() { * The setup is done as a test, both to record its failure, and to allow execution in the server. */ public void testSetup() { - new AdvancedTableCreator().replaceTables(JUnitTestCase.getServerSession("fieldaccess")); + ServerSession session = getPersistenceUnitServerSession(); + new AdvancedTableCreator().replaceTables(session); // Force uppercase for Postgres. - if (getServerSession("fieldaccess").getPlatform().isPostgreSQL()) { - getServerSession().getLogin().setShouldForceFieldNamesToUpperCase(true); + if (session.getPlatform().isPostgreSQL()) { + session.getLogin().setShouldForceFieldNamesToUpperCase(true); } } // JUnit framework will automatically execute all methods starting with test... public void testRefreshNotManaged() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); emp.setFirstName("testRefreshNotManaged"); @@ -250,7 +277,7 @@ public void testRefreshRemoved() { // find an existing or create a new Employee String firstName = "testRefreshRemoved"; Employee emp; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); List result = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'").getResultList(); if(!result.isEmpty()) { emp = (Employee)result.get(0); @@ -274,7 +301,7 @@ public void testRefreshRemoved() { beginTransaction(em); emp = em.find(Employee.class, emp.getId()); - if (getServerSession("fieldaccess").getPlatform().isSymfoware()){ + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()){ // Symfoware does not support deleteall with multiple table em.createNativeQuery("DELETE FROM CMP3_FA_EMPLOYEE WHERE F_NAME = '"+firstName+"'").executeUpdate(); } else { @@ -295,7 +322,7 @@ public void testRefreshRemoved() { } public void testCacheUsage() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee emp = new Employee(); emp.setFirstName("Mark"); // persist the Employee @@ -309,13 +336,13 @@ public void testCacheUsage() { } throw ex; } - clearCache("fieldaccess"); + clearCache(); // Create new entity manager to avoid extended uow of work cache hits. - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); List result = em.createQuery("SELECT OBJECT(e) FROM Employee e").getResultList(); commitTransaction(em); - Object obj = getServerSession("fieldaccess").getIdentityMapAccessor().getFromIdentityMap(result.get(0)); + Object obj = getPersistenceUnitServerSession().getIdentityMapAccessor().getFromIdentityMap(result.get(0)); assertTrue("Failed to load the object into the shared cache when there were no changes in the UOW", obj != null); try{ beginTransaction(em); @@ -334,7 +361,7 @@ public void testContainsRemoved() { // find an existing or create a new Employee String firstName = "testContainsRemoved"; Employee emp; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); List result = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'").getResultList(); if(!result.isEmpty()) { emp = (Employee)result.get(0); @@ -400,7 +427,7 @@ public void internalTestFlushMode(FlushModeType emFlushMode, FlushModeType query String firstName = "testFlushMode"; // make sure no Employee with the specified firstName exists. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try{ beginTransaction(em); Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -414,7 +441,7 @@ public void internalTestFlushMode(FlushModeType emFlushMode, FlushModeType query } throw ex; } - clearCache("fieldaccess"); + clearCache(); FlushModeType emFlushModeOriginal = em.getFlushMode(); Employee emp = new Employee(); @@ -459,7 +486,7 @@ public void testFlushModeOnUpdateQuery() { // find an existing or create a new Employee String firstName = "testFlushModeOnUpdateQuery"; Employee emp; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); emp = new Employee(); emp.setFirstName(firstName); try{ @@ -467,7 +494,7 @@ public void testFlushModeOnUpdateQuery() { beginTransaction(em); Query readQuery = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.phoneNumbers IS EMPTY and e.firstName like '"+firstName+"'"); Query updateQuery = null; - if (getServerSession("fieldaccess").getPlatform().isSymfoware()){ + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()){ updateQuery = em.createNativeQuery("UPDATE CMP3_FA_EMPLOYEE SET VERSION = (VERSION + 1) WHERE F_NAME LIKE '" + firstName + "' AND EMP_ID in (SELECT EMP_ID FROM CMP3_FA_SALARY)"); } else { updateQuery = em.createQuery("UPDATE Employee e set e.salary = 100 where e.firstName like '" + firstName + "'"); @@ -475,7 +502,7 @@ public void testFlushModeOnUpdateQuery() { updateQuery.setFlushMode(FlushModeType.AUTO); em.persist(emp); updateQuery.executeUpdate(); - if (getServerSession("fieldaccess").getPlatform().isSymfoware()){ + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()){ updateQuery = em.createNativeQuery("UPDATE CMP3_FA_SALARY SET SALARY = 100 WHERE EMP_ID IN (SELECT EMP_ID FROM CMP3_FA_EMPLOYEE WHERE F_NAME LIKE '" + firstName + "')"); updateQuery.setFlushMode(FlushModeType.AUTO); updateQuery.executeUpdate(); @@ -499,7 +526,7 @@ public void testFlushModeOnUpdateQuery() { } public void testSetRollbackOnly(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = null; Employee emp2 = null; @@ -520,8 +547,8 @@ public void testSetRollbackOnly(){ closeEntityManager(em); throw ex; } - clearCache("fieldaccess"); - em = createEntityManager("fieldaccess"); + clearCache(); + em = createEntityManager(); beginTransaction(em); List result = em.createQuery("SELECT e FROM Employee e where e.id = " + emp.getId() + " or e.id = " + emp2.getId()).getResultList(); emp = (Employee)result.get(0); @@ -571,7 +598,7 @@ public void testSetRollbackOnly(){ } public void testSubString() { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testSubString skipped for this platform, " + "Symfoware doesn't allow dynamic parameter as first argument of SUBSTRING."); return; @@ -580,7 +607,7 @@ public void testSubString() { // find an existing or create a new Employee String firstName = "testSubString"; Employee emp; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); List result = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'").getResultList(); if(!result.isEmpty()) { emp = (Employee)result.get(0); @@ -624,7 +651,7 @@ public void testSubString() { } public void testDatabaseSyncNewObject() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); @@ -654,7 +681,7 @@ public void testTransactionRequired() { String wrongException = ""; try { - createEntityManager("fieldaccess").flush(); + createEntityManager().flush(); noException = noException + " flush;"; } catch (TransactionRequiredException transactionRequiredException) { // expected behavior @@ -678,7 +705,7 @@ public void testTransactionRequired() { } public void testIdentityInsideTransaction() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Query query = em.createQuery("SELECT e FROM PhoneNumber e"); @@ -694,7 +721,7 @@ public void testIdentityInsideTransaction() { } public void testIdentityOutsideTransaction() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Query query = em.createQuery("SELECT e FROM PhoneNumber e"); List phoneNumbers = query.getResultList(); @@ -708,7 +735,7 @@ public void testIdentityOutsideTransaction() { } public void testIgnoreRemovedObjectsOnDatabaseSync() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Query phoneQuery = em.createQuery("Select p from PhoneNumber p where p.owner.lastName like 'Dow%'"); @@ -758,7 +785,7 @@ public void testIgnoreRemovedObjectsOnDatabaseSync() { }catch (IllegalStateException ex){ rollbackTransaction(em); closeEntityManager(em); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try{ phoneQuery = em.createQuery("Select p from PhoneNumber p where p.owner.lastName like 'Dow%'"); @@ -789,7 +816,7 @@ public void testREADLock() { if (isOnServer()) { return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee employee = null; try{ @@ -805,7 +832,7 @@ public void testREADLock() { closeEntityManager(em); throw ex; } - EntityManager em2 = createEntityManager("fieldaccess"); + EntityManager em2 = createEntityManager(); Exception optimisticLockException = null; beginTransaction(em); @@ -875,7 +902,7 @@ public void testPersistRemoved() { emp.setFirstName(firstName); // make sure no Employee with the specified firstName exists. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -1005,7 +1032,7 @@ public void testPersistRemoved() { // clean up if(employeeExists || exceptionWasThrown) { - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try{ Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -1029,7 +1056,7 @@ public void testPersistRemoved() { } public void testPersistManagedException(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); emp.setFirstName("PersistManagedException"); @@ -1053,7 +1080,7 @@ public void testPersistManagedException(){ } public void testPersistManagedNoException(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); em.persist(emp); @@ -1082,7 +1109,7 @@ public void testRemoveFlushPersistContains() { emp.setFirstName(firstName); // make sure no Employee with the specified firstName exists. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -1154,7 +1181,7 @@ public void testRemoveFlushFind() { emp.setFirstName(firstName); // make sure no Employee with the specified firstName exists. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -1227,7 +1254,7 @@ public void testRemoveFlushFind() { // test for bug 4681287: // CTS: EXCEPTION EXPECTED ON FIND() IF PK PASSED IN != ATTRIBUTE TYPE public void testFindWithWrongTypePk() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { em.find(Employee.class, "1"); } catch (IllegalArgumentException ilEx) { @@ -1243,7 +1270,7 @@ public void testFindWithWrongTypePk() { //test for gf721 - IllegalArgumentException expected for null PK public void testFindWithNullPk() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { em.find(Employee.class, null); } catch (IllegalArgumentException iae) { @@ -1260,7 +1287,7 @@ public void testCheckVersionOnMerge() { Employee employee = new Employee(); employee.setFirstName("Marc"); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try{ beginTransaction(em); em.persist(employee); @@ -1299,7 +1326,7 @@ public void testCheckVersionOnMerge() { public void testClear(){ Employee employee = new Employee(); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ em.persist(employee); @@ -1318,7 +1345,7 @@ public void testClear(){ } public void testClearWithFlush(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { Employee emp = new Employee(); @@ -1333,8 +1360,8 @@ public void testClearWithFlush(){ closeEntityManager(em); throw ex; } - clearCache("fieldaccess"); - em = createEntityManager("fieldaccess"); + clearCache(); + em = createEntityManager(); beginTransaction(em); Employee emp = null; String originalName = ""; @@ -1360,7 +1387,7 @@ public void testClearWithFlush(){ throw exception; } finally { //now clean up - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); emp = em.find(Employee.class, emp.getId()); emp.setFirstName(originalName); @@ -1375,7 +1402,7 @@ public void testClearWithFlush(){ } public void testClearInTransaction(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ Employee emp = new Employee(); @@ -1390,8 +1417,8 @@ public void testClearInTransaction(){ closeEntityManager(em); throw ex; } - clearCache("fieldaccess"); - em = createEntityManager("fieldaccess"); + clearCache(); + em = createEntityManager(); beginTransaction(em); Employee emp = null; String originalName = ""; @@ -1447,7 +1474,7 @@ public void testExtendedPersistenceContext() { empToBeMerged.setSalary(originalSalary); // setup: make sure no Employee with the specified firstName exists and create the existing employees. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -1468,10 +1495,10 @@ public void testExtendedPersistenceContext() { throw ex; } closeEntityManager(em); - clearCache("fieldaccess"); + clearCache(); // create entityManager with extended Persistence Context. - em = createEntityManager("fieldaccess"); + em = createEntityManager(); try { // first test @@ -1521,7 +1548,7 @@ public void testExtendedPersistenceContext() { } // verify objects are correct in the db after transaction - clearCache("fieldaccess"); + clearCache(); Employee empNewFound = em.find(Employee.class, empNew.getId()); if(empNewFound == null) { fail("empNew not in the db after transaction committed"); @@ -1587,7 +1614,7 @@ public void testExtendedPersistenceContext() { } // verify objects are correct in the db - clearCache("fieldaccess"); + clearCache(); Employee empNewFound2 = em.find(Employee.class, empNew.getId()); if(empNewFound2 != null) { fail("empNew still in the db after the second transaction committed"); @@ -1619,7 +1646,7 @@ public void testExtendedPersistenceContext() { em.remove(empToBeRemoved); // Use another EntityManager to alter empToBeRefreshed in the db - EntityManager em2 = createEntityManager("fieldaccess"); + EntityManager em2 = createEntityManager(); em2.getTransaction().begin(); try{ empToBeRefreshed = em2.find(Employee.class, empToBeRefreshed.getId()); @@ -1664,7 +1691,7 @@ public void testExtendedPersistenceContext() { } // verify objects are correct in the db after the third transaction rolled back - clearCache("fieldaccess"); + clearCache(); Employee empNewFound3 = em.find(Employee.class, empNew.getId()); if(empNewFound3 != null) { fail("empNew is in the db after the third transaction rolled back"); @@ -1745,7 +1772,7 @@ public void testReadTransactionIsolation_OriginalInCache_UpdateAll_Refresh_Flush } protected void internalTestReadTransactionIsolation(boolean shouldOriginalBeInParentCache, boolean shouldUpdateAll, boolean shouldRefresh, boolean shouldFlush) { - if (shouldUpdateAll && (JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (shouldUpdateAll && getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("A testReadTransactionIsolation test skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -1755,7 +1782,7 @@ protected void internalTestReadTransactionIsolation(boolean shouldOriginalBeInPa String firstName = "testReadTransactionIsolation"; // make sure no Employee with the specified firstName exists. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ Query q = em.createQuery("SELECT e FROM Employee e WHERE e.firstName = '"+firstName+"'"); @@ -1770,7 +1797,7 @@ protected void internalTestReadTransactionIsolation(boolean shouldOriginalBeInPa closeEntityManager(em); throw ex; } - clearCache("fieldaccess"); + clearCache(); em.clear(); // create and persist the object @@ -1793,7 +1820,7 @@ protected void internalTestReadTransactionIsolation(boolean shouldOriginalBeInPa } if(!shouldOriginalBeInParentCache) { - clearCache("fieldaccess"); + clearCache(); } em.clear(); @@ -1873,14 +1900,14 @@ protected void internalTestReadTransactionIsolation(boolean shouldOriginalBeInPa closeEntityManager(em); throw ex; } - clearCache("fieldaccess"); + clearCache(); closeEntityManager(em); } // test for bug 4755392: // AFTER DELETEALL OBJECT STILL DEEMED EXISTING public void testFindDeleteAllPersist() { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testFindDeleteAllPersist skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -1897,7 +1924,7 @@ public void testFindDeleteAllPersist() { empWithoutAddress.setFirstName(firstName); empWithoutAddress.setLastName("WithoutAddress"); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); // make sure no Employee with the specified firstName exists. beginTransaction(em); @@ -1927,7 +1954,7 @@ public void testFindDeleteAllPersist() { } // clear cache - clearCache("fieldaccess"); + clearCache(); em.clear(); // Find both to bring into the cache, delete empWithoutAddress. @@ -1994,7 +2021,7 @@ public void testWRITELock() { if (isOnServer()) { return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee employee = new Employee(); employee.setFirstName("Mark"); employee.setLastName("Madsen"); @@ -2010,7 +2037,7 @@ public void testWRITELock() { throw ex; } - EntityManager em2 = createEntityManager("fieldaccess"); + EntityManager em2 = createEntityManager(); Exception optimisticLockException = null; beginTransaction(em); @@ -2062,7 +2089,7 @@ public void testWRITELock() { public void testPersistOnNonEntity() { boolean testPass = false; Object nonEntity = new Object(); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.persist(nonEntity); @@ -2079,7 +2106,7 @@ public void testClose() { if (isOnServer()) { return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); if (!em.isOpen()) { fail("Created EntityManager is not open"); } @@ -2094,7 +2121,7 @@ public void testBeginTransactionClose() { if (isOnServer()) { return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try{ closeEntityManager(em); @@ -2123,7 +2150,7 @@ public void testBeginTransactionCloseCommitTransaction() { return; } String firstName = "testBeginTrCloseCommitTr"; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); // make sure there is no employees with this firstName beginTransaction(em); @@ -2159,7 +2186,7 @@ public void testBeginTransactionCloseCommitTransaction() { } // verify that the employee has been persisted - em = createEntityManager("fieldaccess"); + em = createEntityManager(); RuntimeException exception = null; try { Employee persistedEmployee = (Employee)em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'").getSingleResult(); @@ -2186,7 +2213,7 @@ public void testBeginTransactionCloseCommitTransaction() { // The test removed because we moved back to binding literals // on platforms other than DB2 and Derby /* public void testDontBindLiteral() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Query controlQuery = em.createQuery("SELECT OBJECT(p) FROM SmallProject p WHERE p.name = CONCAT(:param1, :param2)"); controlQuery.setParameter("param1", "A").setParameter("param2", "B"); @@ -2212,7 +2239,7 @@ public void testPersistenceProperties() { return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); ServerSession ss = ((org.eclipse.persistence.internal.jpa.EntityManagerImpl)em.getDelegate()).getServerSession(); // these properties were set in persistence unit @@ -2311,14 +2338,14 @@ public void testPersistenceProperties() { } public void testMultipleFactories() { - getEntityManagerFactory("fieldaccess"); + getEntityManagerFactory(); closeEntityManagerFactory(); - boolean isOpen = getEntityManagerFactory("fieldaccess").isOpen(); + boolean isOpen = getEntityManagerFactory().isOpen(); if(!isOpen) { fail("Close factory 1; open factory 2 - it's not open"); } else { // Get entity manager just to login back the session, then close em - getEntityManagerFactory("fieldaccess").createEntityManager().close(); + getEntityManagerFactory().createEntityManager().close(); } } @@ -2327,9 +2354,9 @@ public void testParallelMultipleFactories() { // Cannot connect locally on server. return; } - EntityManagerFactory factory1 = Persistence.createEntityManagerFactory("fieldaccess", JUnitTestCaseHelper.getDatabaseProperties()); + EntityManagerFactory factory1 = Persistence.createEntityManagerFactory(getPersistenceUnitName(), JUnitTestCaseHelper.getDatabaseProperties()); factory1.createEntityManager(); - EntityManagerFactory factory2 = Persistence.createEntityManagerFactory("fieldaccess", JUnitTestCaseHelper.getDatabaseProperties()); + EntityManagerFactory factory2 = Persistence.createEntityManagerFactory(getPersistenceUnitName(), JUnitTestCaseHelper.getDatabaseProperties()); factory2.createEntityManager(); factory1.close(); if(factory1.isOpen()) { @@ -2342,7 +2369,7 @@ public void testParallelMultipleFactories() { if(factory2.isOpen()) { fail("after factory2.close() factory2 is not closed"); } - EntityManagerFactory factory3 = Persistence.createEntityManagerFactory("fieldaccess", JUnitTestCaseHelper.getDatabaseProperties()); + EntityManagerFactory factory3 = Persistence.createEntityManagerFactory(getPersistenceUnitName(), JUnitTestCaseHelper.getDatabaseProperties()); if(!factory3.isOpen()) { fail("factory3 is closed"); } @@ -2354,7 +2381,7 @@ public void testParallelMultipleFactories() { } public void testQueryHints() { - EntityManager em = getEntityManagerFactory("fieldaccess").createEntityManager(); + EntityManager em = getEntityManagerFactory().createEntityManager(); Query query = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = 'testQueryHints'"); ObjectLevelReadQuery olrQuery = (ObjectLevelReadQuery)((EJBQueryImpl)query).getDatabaseQuery(); @@ -2456,7 +2483,7 @@ public void testQueryHints() { } public void testQueryTimeOut() { - EntityManager em = getEntityManagerFactory("fieldaccess").createEntityManager(); + EntityManager em = getEntityManagerFactory().createEntityManager(); Query query = em.createQuery("SELECT d FROM Department d"); ObjectLevelReadQuery olrQuery = (ObjectLevelReadQuery)((EJBQueryImpl)query).getDatabaseQuery(); @@ -2482,7 +2509,7 @@ public void testQueryTimeOut() { */ public void testBatchQueryHint(){ int id1 = 0; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee manager = new Employee(); @@ -2520,7 +2547,7 @@ public void testBatchQueryHint(){ commitTransaction(em); em.clear(); - JpaQuery query = (JpaQuery)getEntityManagerFactory("fieldaccess").createEntityManager().createQuery("SELECT e FROM Employee e WHERE e.lastName = 'Malone' order by e.firstName"); + JpaQuery query = (JpaQuery)getEntityManagerFactory().createEntityManager().createQuery("SELECT e FROM Employee e WHERE e.lastName = 'Malone' order by e.firstName"); query.setHint(QueryHints.BATCH, "e.phoneNumbers"); query.setHint(QueryHints.BATCH, "e.manager.phoneNumbers"); @@ -2568,7 +2595,7 @@ public void testBatchQueryHint(){ */ public void testFetchQueryHint(){ int id1 = 0; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee manager = new Employee(); @@ -2606,7 +2633,7 @@ public void testFetchQueryHint(){ commitTransaction(em); em.clear(); - JpaQuery query = (JpaQuery)getEntityManagerFactory("fieldaccess").createEntityManager().createQuery("SELECT e FROM Employee e WHERE e.lastName = 'Malone' order by e.firstName"); + JpaQuery query = (JpaQuery)getEntityManagerFactory().createEntityManager().createQuery("SELECT e FROM Employee e WHERE e.lastName = 'Malone' order by e.firstName"); query.setHint(QueryHints.FETCH, "e.manager"); ReadAllQuery raq = (ReadAllQuery)query.getDatabaseQuery(); List expressions = raq.getJoinedAttributeExpressions(); @@ -2637,7 +2664,7 @@ public void testFetchQueryHint(){ * Test that the proper exception is thrown when an incorrect batch or fetch query hint is set on the queyr. */ public void testIncorrectBatchQueryHint(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); QueryException exception = null; try{ Query query = em.createQuery("SELECT e FROM Employee e WHERE e.lastName = 'Malone' order by e.firstName"); @@ -2714,7 +2741,7 @@ public void testQueryOnClosedEM() { return; } boolean exceptionWasThrown = false; - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Query q = em.createQuery("SELECT e FROM Employee e "); closeEntityManager(em); if(em.isOpen()) { @@ -2731,12 +2758,12 @@ public void testQueryOnClosedEM() { } public void testNullifyAddressIn() { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testNullifyAddressIn skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.createQuery("UPDATE Employee e SET e.address = null WHERE e.address.country IN ('Canada', 'US')").executeUpdate(); @@ -2748,7 +2775,7 @@ public void testNullifyAddressIn() { //test for bug 5234283: WRONG =* SQL FOR LEFT JOIN ON DERBY AND DB2 PLATFORMS public void testLeftJoinOneToOneQuery() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); List results = em.createQuery("SELECT a FROM Employee e LEFT JOIN e.address a").getResultList(); results.toString(); closeEntityManager(em); @@ -2756,7 +2783,7 @@ public void testLeftJoinOneToOneQuery() { // test for GlassFish bug 711 - throw a descriptive exception when an uninstantiated valueholder is serialized and then accessed public void testSerializedLazy(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); @@ -2771,8 +2798,8 @@ public void testSerializedLazy(){ em.flush(); commitTransaction(em); closeEntityManager(em); - clearCache("fieldaccess"); - em = createEntityManager("fieldaccess"); + clearCache(); + em = createEntityManager(); String ejbqlString = "SELECT e FROM Employee e WHERE e.firstName = 'Owen' and e.lastName = 'Hargreaves'"; List result = em.createQuery(ejbqlString).getResultList(); emp = (Employee)result.get(0); @@ -2811,8 +2838,8 @@ public void testSerializedLazy(){ //test for bug 5170395: GET THE SEQUENCING EXCEPTION WHEN RUNNING FOR THE FIRST TIME ON A CLEAR SCHEMA public void testSequenceObjectDefinition() { - EntityManager em = createEntityManager("fieldaccess"); - ServerSession ss = getServerSession("fieldaccess"); + EntityManager em = createEntityManager(); + ServerSession ss = getPersistenceUnitServerSession(); if(!ss.getLogin().getPlatform().supportsSequenceObjects()) { // platform that supports sequence objects is required for this test closeEntityManager(em); @@ -2851,7 +2878,7 @@ protected void internalTestSequenceObjectDefinition(int preallocationSize, int s sequence.onDisconnect(ss.getPlatform()); // Symfoware doesn't allow drop while connections that performed // CREATE and DML on the sequence are still open. - if (JUnitTestCase.getServerSession("fieldaccess").getPlatform().isSymfoware()) return; + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) return; // drop sequence String dropStr = def.buildDeletionWriter(ss, new StringWriter()).toString(); beginTransaction(em); @@ -2862,8 +2889,8 @@ protected void internalTestSequenceObjectDefinition(int preallocationSize, int s public void testMergeDetachedObject() { // Step 1 - read a department and clear the cache. - clearCache("fieldaccess"); - EntityManager em = createEntityManager("fieldaccess"); + clearCache(); + EntityManager em = createEntityManager(); Query query = em.createNamedQuery("findAllSQLDepartments"); Collection departments = query.getResultList(); @@ -2882,11 +2909,11 @@ public void testMergeDetachedObject() { } closeEntityManager(em); - clearCache("fieldaccess"); + clearCache(); // Step 2 - create a new em, create a new employee with the // detached department and then query the departments again. - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); @@ -2904,7 +2931,7 @@ public void testMergeDetachedObject() { em.createNamedQuery("findAllSQLDepartments").getResultList(); } catch (RuntimeException e){ - getServerSession("fieldaccess").log(new SessionLogEntry(getServerSession("fieldaccess"), SessionLog.WARNING, SessionLog.TRANSACTION, e)); + getPersistenceUnitServerSession().log(new SessionLogEntry(getPersistenceUnitServerSession(), SessionLog.WARNING, SessionLog.TRANSACTION, e)); } closeEntityManager(em); } @@ -2917,7 +2944,7 @@ public void testMergeRemovedObject() { emp.setId(42); //persist the Employee - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try{ beginTransaction(em); em.persist(emp); @@ -2951,7 +2978,7 @@ public void testMergeRemovedObject() { //merge(null) should throw IllegalArgumentException public void testMergeNull(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.merge(null); @@ -2968,7 +2995,7 @@ public void testMergeNull(){ //persist(null) should throw IllegalArgumentException public void testPersistNull(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.persist(null); @@ -2985,7 +3012,7 @@ public void testPersistNull(){ //contains(null) should throw IllegalArgumentException public void testContainsNull(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.contains(null); @@ -3002,7 +3029,7 @@ public void testContainsNull(){ //bug gf732 - removing null entity should throw an IllegalArgumentException public void testRemoveNull(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.remove(null); @@ -3019,7 +3046,7 @@ public void testRemoveNull(){ //Glassfish bug 702 - prevent primary key updates public void testPrimaryKeyUpdate() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); @@ -3068,7 +3095,7 @@ public void testPrimaryKeyUpdate() { //Glassfish bug 702 - prevent primary key updates, same value is ok public void testPrimaryKeyUpdateSameValue() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); @@ -3097,7 +3124,7 @@ public void testPrimaryKeyUpdateSameValue() { //Glassfish bug 702 - prevent primary key updates, overlapping PK/FK public void testPrimaryKeyUpdatePKFK() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp = new Employee(); @@ -3164,7 +3191,7 @@ public void testCascadeMergeDetached() { Employee e2 = new Employee(); e2.setFirstName("Employee2"); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.persist(p1); @@ -3193,7 +3220,7 @@ public void testCascadeMergeDetached() { e2.addProject(p2); p2.addTeamMember(e2); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { Project mp1 = em.merge(p1); // cascade merge @@ -3235,7 +3262,7 @@ public void testCascadeMergeManaged() { Employee e2 = new Employee(); e2.setFirstName("Employee2"); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.persist(p1); @@ -3254,7 +3281,7 @@ public void testCascadeMergeManaged() { // end of setup //p1,p2,e1,e2 are detached - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { Project mp1 = em.merge(p1); @@ -3298,8 +3325,8 @@ public void testCascadeMergeManaged() { //Glassfish bug 1021 - allow cascading persist operation to non-entities public void testCascadePersistToNonEntitySubclass() { - EntityManager em = createEntityManager("fieldaccess"); - InheritancePolicy ip = getServerSession("fieldaccess").getDescriptor(Project.class).getInheritancePolicy(); + EntityManager em = createEntityManager(); + InheritancePolicy ip = getPersistenceUnitServerSession().getDescriptor(Project.class).getInheritancePolicy(); boolean describesNonPersistentSubclasses = ip.getDescribesNonPersistentSubclasses(); ip.setDescribesNonPersistentSubclasses(true); @@ -3343,7 +3370,7 @@ public void testInitializeFieldForPropertyAccess() { address.setCity("Shawshank"); employee.setAddressField(address); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); em.persist(employee); try { @@ -3356,9 +3383,9 @@ public void testInitializeFieldForPropertyAccess() { } int id = employee.getId(); - clearCache("fieldaccess"); + clearCache(); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { employee = em.find(Employee.class, id); @@ -3382,7 +3409,7 @@ public void testInitializeFieldForPropertyAccess() { * In this test we test making the change after the object is managed */ public void testSetFieldForPropertyAccess() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee employee = new Employee(); employee.setFirstName("Andy"); @@ -3413,9 +3440,9 @@ public void testSetFieldForPropertyAccess() { throw e; } - clearCache("fieldaccess"); + clearCache(); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { employee = em.find(Employee.class, id); @@ -3442,7 +3469,7 @@ public void testSetFieldForPropertyAccess() { * In this test we test making the change after the object is refreshed */ public void testSetFieldForPropertyAccessWithRefresh() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee employee = new Employee(); employee.setFirstName("Andy"); @@ -3474,9 +3501,9 @@ public void testSetFieldForPropertyAccessWithRefresh() { throw e; } - clearCache("fieldaccess"); + clearCache(); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { employee = em.find(Employee.class, id); @@ -3503,7 +3530,7 @@ public void testSetFieldForPropertyAccessWithRefresh() { * In this test we test making the change when an existing object is read into a new EM */ public void testSetFieldForPropertyAccessWithNewEM(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee employee = new Employee(); employee.setFirstName("Andy"); @@ -3518,7 +3545,7 @@ public void testSetFieldForPropertyAccessWithNewEM(){ int id = employee.getId(); int addressId = address.getId(); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); employee = em.find(Employee.class, id); @@ -3536,9 +3563,9 @@ public void testSetFieldForPropertyAccessWithNewEM(){ throw e; } - clearCache("fieldaccess"); + clearCache(); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { employee = em.find(Employee.class, id); @@ -3560,7 +3587,7 @@ public void testSetFieldForPropertyAccessWithNewEM(){ //bug gf674 - EJBQL delete query with IS NULL in WHERE clause produces wrong sql public void testDeleteAllPhonesWithNullOwner() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.createQuery("DELETE FROM PhoneNumber ph WHERE ph.owner IS NULL").executeUpdate(); @@ -3574,7 +3601,7 @@ public void testDeleteAllPhonesWithNullOwner() { } } public void testDeleteAllProjectsWithNullTeamLeader() { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testDeleteAllProjectsWithNullTeamLeader skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -3585,7 +3612,7 @@ public void testDeleteAllSmallProjectsWithNullTeamLeader() { internalDeleteAllProjectsWithNullTeamLeader("SmallProject"); } public void testDeleteAllLargeProjectsWithNullTeamLeader() { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testDeleteAllLargeProjectsWithNullTeamLeader skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -3600,7 +3627,7 @@ protected void internalDeleteAllProjectsWithNullTeamLeader(String className) { sp.setName(name); LargeProject lp = new LargeProject(); lp.setName(name); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { beginTransaction(em); // make sure there are no pre-existing objects with this name @@ -3618,7 +3645,7 @@ protected void internalDeleteAllProjectsWithNullTeamLeader(String className) { } // test - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { em.createQuery("DELETE FROM "+className+" p WHERE p.name = '"+name+"' AND p.teamLeader IS NULL").executeUpdate(); @@ -3634,7 +3661,7 @@ protected void internalDeleteAllProjectsWithNullTeamLeader(String className) { // verify String error = null; - em = createEntityManager("fieldaccess"); + em = createEntityManager(); List result = em.createQuery("SELECT OBJECT(p) FROM Project p WHERE p.name = '"+name+"'").getResultList(); if(result.isEmpty()) { if(!className.equals("Project")) { @@ -3683,7 +3710,7 @@ public void testUpdateUsingTempStorageWithParameter() { internalUpdateUsingTempStorage(true); } protected void internalUpdateUsingTempStorage(boolean useParameter) { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testUpdateUsingTempStorage* skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -3693,7 +3720,7 @@ protected void internalUpdateUsingTempStorage(boolean useParameter) { int n = 3; // setup - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { beginTransaction(em); // make sure there are no pre-existing objects with this name @@ -3726,7 +3753,7 @@ protected void internalUpdateUsingTempStorage(boolean useParameter) { } // test - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); int nUpdated = 0; try { @@ -3745,7 +3772,7 @@ protected void internalUpdateUsingTempStorage(boolean useParameter) { // verify String error = null; - em = createEntityManager("fieldaccess"); + em = createEntityManager(); List result = em.createQuery("SELECT OBJECT(e) FROM Employee e WHERE e.firstName = '"+firstName+"'").getResultList(); closeEntityManager(em); int nReadBack = result.size(); @@ -3770,7 +3797,7 @@ protected void internalUpdateUsingTempStorage(boolean useParameter) { } // clean up - em = createEntityManager("fieldaccess"); + em = createEntityManager(); try { beginTransaction(em); // make sure there are no objects left with this name @@ -3792,7 +3819,7 @@ protected void internalUpdateUsingTempStorage(boolean useParameter) { } protected void createProjectsWithName(String name, Employee teamLeader) { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { beginTransaction(em); @@ -3830,7 +3857,7 @@ protected void createProjectsWithName(String name, Employee teamLeader) { } protected void deleteProjectsWithName(String name) { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { beginTransaction(em); @@ -3857,7 +3884,7 @@ public void testUpdateAllProjects() { internalTestUpdateAllProjects(Project.class); } protected void internalTestUpdateAllProjects(Class cls) { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testUpdateAll*Projects skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -3875,7 +3902,7 @@ protected void internalTestUpdateAllProjects(Class cls) { createProjectsWithName(name, null); // save the original names of projects: will set them back in cleanup // to restore the original state. - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); List projects = em.createQuery("SELECT OBJECT(p) FROM Project p").getResultList(); map = new HashMap(projects.size()); for(int i=0; i cls) { } // verify - em = createEntityManager("fieldaccess"); + em = createEntityManager(); String errorMsg = ""; projects = em.createQuery("SELECT OBJECT(p) FROM Project p").getResultList(); for(int i=0; i cls) { // clean-up try { if(map != null) { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); List projects = em.createQuery("SELECT OBJECT(p) FROM Project p").getResultList(); try { @@ -3965,7 +3992,7 @@ public void testUpdateAllProjectsWithName() { internalTestUpdateAllProjectsWithName(Project.class); } protected void internalTestUpdateAllProjectsWithName(Class cls) { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testUpdateAll*ProjectsWithName skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); return; @@ -3984,7 +4011,7 @@ protected void internalTestUpdateAllProjectsWithName(Class cls) { createProjectsWithName(name, null); // test - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.createQuery("UPDATE "+className+" p set p.name = '"+newName+"' WHERE p.name = '"+name+"'").executeUpdate(); @@ -3999,7 +4026,7 @@ protected void internalTestUpdateAllProjectsWithName(Class cls) { } // verify - em = createEntityManager("fieldaccess"); + em = createEntityManager(); String errorMsg = ""; List projects = em.createQuery("SELECT OBJECT(p) FROM Project p WHERE p.name = '"+newName+"' OR p.name = '"+name+"'").getResultList(); for(int i=0; i cls) { - if ((JUnitTestCase.getServerSession("fieldaccess")).getPlatform().isSymfoware()) { + if (getPersistenceUnitServerSession().getPlatform().isSymfoware()) { getServerSession().logMessage("Test testUpdateAll*ProjectsWithNullTeamLeader skipped for this platform, " + "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193)."); } @@ -4062,7 +4089,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { // make sure no projects with the specified names exist deleteProjectsWithName(name); deleteProjectsWithName(newName); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee emp = null; List employees = em.createQuery("SELECT OBJECT(e) FROM Employee e").getResultList(); if(employees.size() > 0) { @@ -4089,7 +4116,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { createProjectsWithName(name, emp); // test - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); try { em.createQuery("UPDATE "+className+" p set p.name = '"+newName+"' WHERE p.name = '"+name+"' AND p.teamLeader IS NULL").executeUpdate(); @@ -4104,7 +4131,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { } // verify - em = createEntityManager("fieldaccess"); + em = createEntityManager(); String errorMsg = ""; List projects = em.createQuery("SELECT OBJECT(p) FROM Project p WHERE p.name = '"+newName+"' OR p.name = '"+name+"'").getResultList(); for(int i=0; i cls) { deleteProjectsWithName(name); deleteProjectsWithName(newName); if(empTemp != null) { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { em.createQuery("DELETE FROM Employee e WHERE e.id = '"+empTemp.getId()+"'").executeUpdate(); @@ -4158,7 +4185,7 @@ protected void internalTestUpdateAllProjectsWithNullTeamLeader(Class cls) { } public void testRollbackOnlyOnException() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { Employee emp = em.find(Employee.class, ""); @@ -4182,7 +4209,7 @@ public void testClosedEmShouldThrowException() { return; } - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); closeEntityManager(em); String errorMsg = ""; @@ -4254,7 +4281,7 @@ public void testOneToManyDefaultJoinTableName() { Employee manager = new Employee(); dept.addManager(manager); - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { beginTransaction(em); em.persist(dept); @@ -4279,9 +4306,9 @@ public void testMultipleEntityManagerFactories() { // close the original factory closeEntityManagerFactory(); // create the new one - not yet deployed - EntityManagerFactory factory1 = getEntityManagerFactory("fieldaccess"); + EntityManagerFactory factory1 = getEntityManagerFactory(); // create the second one - EntityManagerFactory factory2 = Persistence.createEntityManagerFactory("fieldaccess", JUnitTestCaseHelper.getDatabaseProperties()); + EntityManagerFactory factory2 = Persistence.createEntityManagerFactory(getPersistenceUnitName(), JUnitTestCaseHelper.getDatabaseProperties()); // deploy factory2.createEntityManager(); // close @@ -4299,7 +4326,7 @@ public void testMultipleEntityManagerFactories() { // gf2074: EM.clear throws NPE public void testClearEntityManagerWithoutPersistenceContext() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); try { em.clear(); }finally { @@ -4345,7 +4372,7 @@ protected void markTransactionForRollback_impl() {} // gf2074: EM.clear throws NPE (JTA case) public void testClearEntityManagerWithoutPersistenceContextSimulateJTA() { - ServerSession ss = getServerSession("fieldaccess"); + ServerSession ss = getPersistenceUnitServerSession(); // in non-JTA case session doesn't have external transaction controller boolean hasExternalTransactionController = ss.hasExternalTransactionController(); if (!hasExternalTransactionController) { @@ -4371,8 +4398,8 @@ public void testDescriptorNamedQuery(){ query.addArgument("fName", String.class); query.addArgument("lName", String.class); - EntityManager em = createEntityManager("fieldaccess"); - Session session = getServerSession("fieldaccess"); + EntityManager em = createEntityManager(); + Session session = getPersistenceUnitServerSession(); ClassDescriptor descriptor = session.getDescriptor(Employee.class); descriptor.getQueryManager().addQuery("findByFNameLName", query); @@ -4412,8 +4439,8 @@ public void testDescriptorNamedQueryForMultipleQueries(){ ReadAllQuery query2 = new ReadAllQuery(Employee.class); - EntityManager em = createEntityManager("fieldaccess"); - Session session = getServerSession("fieldaccess"); + EntityManager em = createEntityManager(); + Session session = getPersistenceUnitServerSession(); ClassDescriptor descriptor = session.getDescriptor(Employee.class); descriptor.getQueryManager().addQuery("findEmployees", query); descriptor.getQueryManager().addQuery("findEmployees", query2); @@ -4447,7 +4474,7 @@ public void testDescriptorNamedQueryForMultipleQueries(){ // GF 2621 public void testDoubleMerge(){ - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); Employee employee = new Employee(); employee.setId(44); @@ -4473,7 +4500,7 @@ public void testDoubleMerge(){ // Test the clone method works correctly with lazy attributes. public void testCloneable() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { @@ -4492,9 +4519,9 @@ public void testCloneable() { fail("Changing clone address changed original."); } commitTransaction(em); - clearCache("fieldaccess"); + clearCache(); closeEntityManager(em); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); employee = em.find(Employee.class, clone.getId()); clone = employee.clone(); @@ -4540,7 +4567,7 @@ public void testCopyingAddress() { // This test weaving works when accessing a superclass field in a subclass. public void testSuperclassFieldInSubclass() { - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); try { Employee employee = new Employee(); @@ -4550,7 +4577,7 @@ public void testSuperclassFieldInSubclass() { em.persist(project); commitTransaction(em); closeEntityManager(em); - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); employee = em.find(Employee.class, employee.getId()); project = em.find(LargeProject.class, project.getId()); @@ -4611,7 +4638,7 @@ public void internalTestWeaving(Object object, boolean changeTracking, boolean i if (changeTracking && (!(object instanceof ChangeTracker))) { fail("Object not weaved for ChangeTracker:" + object); } - ClassDescriptor descriptor = getServerSession("fieldaccess").getDescriptor(object); + ClassDescriptor descriptor = getPersistenceUnitServerSession().getDescriptor(object); if (!descriptor.isAggregateDescriptor()) { if (changeTracking != descriptor.getObjectChangePolicy().isAttributeChangeTrackingPolicy()) { fail("Descriptor not set to use change tracking policy correctly:" + object); @@ -4633,7 +4660,7 @@ public void internalTestWeaving(Object object, boolean changeTracking, boolean i */ public void testSequencePreallocationUsingCallbackTest() { // setup - ServerSession ss = getServerSession("fieldaccess"); + ServerSession ss = getPersistenceUnitServerSession(); // make sure the sequence has both preallocation and callback // (the latter means not using sequencing connection pool, // acquiring values before insert and requiring transaction). @@ -4641,7 +4668,7 @@ public void testSequencePreallocationUsingCallbackTest() { // fail("setup failure: the test requires serverSession.getSequencingControl().shouldUseSeparateConnection()==false"); //} String seqName = ss.getDescriptor(Employee.class).getSequenceNumberName(); - Sequence sequence = getServerSession("fieldaccess").getLogin().getSequence(seqName); + Sequence sequence = getPersistenceUnitServerSession().getLogin().getSequence(seqName); if(sequence.getPreallocationSize() < 2) { fail("setup failure: the test requires sequence preallocation size greater than 1"); } @@ -4652,10 +4679,10 @@ public void testSequencePreallocationUsingCallbackTest() { fail("setup failure: the test requires sequence that uses transaction, like TableSequence"); } // clear all already allocated sequencing values for seqName - getServerSession("fieldaccess").getSequencingControl().initializePreallocated(seqName); + getPersistenceUnitServerSession().getSequencingControl().initializePreallocated(seqName); // test - EntityManager em = createEntityManager("fieldaccess"); + EntityManager em = createEntityManager(); beginTransaction(em); Employee emp1 = new Employee(); emp1.setFirstName("testSequencePreallocation"); @@ -4665,7 +4692,7 @@ public void testSequencePreallocationUsingCallbackTest() { commitTransaction(em); // verify - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); Employee emp2 = new Employee(); emp2.setFirstName("testSequencePreallocation"); @@ -4677,7 +4704,7 @@ public void testSequencePreallocationUsingCallbackTest() { // cleanup // remove the object that has been created in setup - em = createEntityManager("fieldaccess"); + em = createEntityManager(); beginTransaction(em); emp1 = em.find(Employee.class, assignedSequenceNumber); em.remove(emp1); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ExtendedPersistenceContextJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ExtendedPersistenceContextJUnitTest.java index 6fc1582af8d..3a9d39295b6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ExtendedPersistenceContextJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ExtendedPersistenceContextJUnitTest.java @@ -16,16 +16,15 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.List; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import java.util.List; + public class ExtendedPersistenceContextJUnitTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/FAServerTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/FAServerTestSuite.java index 75890863a83..ca7f5f16858 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/FAServerTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/FAServerTestSuite.java @@ -14,10 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - -import junit.framework.TestSuite; import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; /** *

Purpose: To collect the tests that will run against Application Server only. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/JoinedAttributeAdvancedJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/JoinedAttributeAdvancedJunitTest.java index 19dd03c76b4..8e3c1b1940e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/JoinedAttributeAdvancedJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/JoinedAttributeAdvancedJunitTest.java @@ -16,27 +16,31 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.queries.DeleteAllQuery; import org.eclipse.persistence.queries.ObjectLevelReadQuery; +import org.eclipse.persistence.queries.ReadAllQuery; import org.eclipse.persistence.queries.ReportQuery; import org.eclipse.persistence.queries.UpdateAllQuery; import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.UnitOfWork; import org.eclipse.persistence.testing.framework.JoinedAttributeTestHelper; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.*; -import org.eclipse.persistence.queries.ReadAllQuery; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; public class JoinedAttributeAdvancedJunitTest extends JUnitTestCase { @@ -85,7 +89,7 @@ protected void clear() { emp.setManager(null); emp.setAddress(null); uow.deleteObject(emp); - }; + } } UpdateAllQuery updateProjects = new UpdateAllQuery(Project.class); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/NamedNativeQueryJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/NamedNativeQueryJUnitTest.java index dfde4b462c7..65a707171bc 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/NamedNativeQueryJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/NamedNativeQueryJUnitTest.java @@ -16,8 +16,8 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OSGiTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OSGiTestSuite.java index 44188d11c7e..2143e15c3eb 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OSGiTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OSGiTestSuite.java @@ -14,10 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - -import junit.framework.TestSuite; import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; /** *

Purpose: To collect the tests that will run in OSGi environment. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OptimisticConcurrencyJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OptimisticConcurrencyJUnitTest.java index 0775d8eb54e..97b7d93debb 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OptimisticConcurrencyJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/OptimisticConcurrencyJUnitTest.java @@ -14,16 +14,17 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.*; -import org.eclipse.persistence.exceptions.OptimisticLockException; - -import junit.framework.Test; -import junit.framework.TestSuite; - import jakarta.persistence.EntityManager; -import jakarta.persistence.Query; import jakarta.persistence.PersistenceException; +import jakarta.persistence.Query; +import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.persistence.exceptions.OptimisticLockException; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.ModelExamples; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; /** *

diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryAdvancedJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryAdvancedJUnitTest.java index 93439c24451..21fe9af78c8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryAdvancedJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryAdvancedJUnitTest.java @@ -16,9 +16,8 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.Iterator; -import java.util.Vector; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; @@ -28,12 +27,15 @@ import org.eclipse.persistence.queries.UpdateAllQuery; import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.UnitOfWork; - -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.*; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; -import junit.framework.Test; -import junit.framework.TestSuite; +import java.util.Iterator; +import java.util.Vector; public class ReportQueryAdvancedJUnitTest extends JUnitTestCase { @@ -84,13 +86,14 @@ protected static void clear() { uow.executeQuery(new DeleteAllQuery(Employee.class)); } else { + @SuppressWarnings({"unchecked"}) Iterator emps = uow.readAllObjects(Employee.class).iterator(); while (emps.hasNext()){ Employee emp = emps.next(); emp.setManager(null); emp.setAddress(null); uow.deleteObject(emp); - }; + } } uow.executeQuery(new DeleteAllQuery(PhoneNumber.class)); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryConstructorExpressionTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryConstructorExpressionTest.java index e88c8f31027..a6a9e3d2020 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryConstructorExpressionTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryConstructorExpressionTest.java @@ -16,24 +16,21 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import org.eclipse.persistence.queries.ReportQuery; +import jakarta.persistence.EntityManager; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.exceptions.QueryException; import org.eclipse.persistence.expressions.ExpressionBuilder; +import org.eclipse.persistence.queries.ConstructorReportItem; +import org.eclipse.persistence.queries.ReportQuery; import org.eclipse.persistence.queries.ReportQueryResult; - -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; -import org.eclipse.persistence.queries.ConstructorReportItem; - -import junit.framework.TestSuite; -import junit.framework.Test; - -import jakarta.persistence.EntityManager; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import java.util.Iterator; import java.util.List; import java.util.Vector; -import java.util.Iterator; public class ReportQueryConstructorExpressionTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryMultipleReturnTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryMultipleReturnTest.java index 5644461754f..5a2ea242fd3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryMultipleReturnTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/ReportQueryMultipleReturnTest.java @@ -16,20 +16,19 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.List; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.exceptions.QueryException; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.queries.ReportQuery; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; -import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.LargeProject; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; +import java.util.List; + public class ReportQueryMultipleReturnTest extends JUnitTestCase { protected boolean m_reset = false; // reset gets called twice on error diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/SQLResultSetMappingTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/SQLResultSetMappingTest.java index eb7af842da0..0085184a87f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/SQLResultSetMappingTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/SQLResultSetMappingTest.java @@ -17,25 +17,30 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - import jakarta.persistence.EntityManager; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.jpa.JpaEntityManager; -import org.eclipse.persistence.queries.*; +import org.eclipse.persistence.queries.ColumnResult; +import org.eclipse.persistence.queries.EntityResult; +import org.eclipse.persistence.queries.FieldResult; +import org.eclipse.persistence.queries.ObjectBuildingQuery; +import org.eclipse.persistence.queries.ResultSetMappingQuery; +import org.eclipse.persistence.queries.SQLCall; +import org.eclipse.persistence.queries.SQLResultSetMapping; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.LargeProject; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.SmallProject; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Buyer; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import junit.framework.TestSuite; -import junit.framework.Test; import org.junit.Assert; +import java.util.Iterator; +import java.util.List; +import java.util.Vector; + public class SQLResultSetMappingTest extends JUnitTestCase { protected boolean m_reset = false; // reset gets called twice on error diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/UpdateAllQueryAdvancedJunitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/UpdateAllQueryAdvancedJunitTest.java index 276de995238..1a3e1795921 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/UpdateAllQueryAdvancedJunitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/advanced/UpdateAllQueryAdvancedJunitTest.java @@ -16,13 +16,9 @@ package org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced; -import java.util.HashMap; -import java.util.Vector; - -import junit.framework.*; - import jakarta.persistence.EntityManager; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; @@ -31,14 +27,22 @@ import org.eclipse.persistence.queries.UpdateAllQuery; import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.UnitOfWork; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.*; import org.eclipse.persistence.testing.framework.UpdateAllQueryTestHelper; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Department; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; + +import java.util.HashMap; +import java.util.Vector; public class UpdateAllQueryAdvancedJunitTest extends JUnitTestCase { static protected Class[] classes = {Employee.class, Address.class, PhoneNumber.class, Project.class}; - static protected Vector[] objectVectors = {null, null, null, null}; + static protected Vector[] objectVectors = {null, null, null, null}; static protected EmployeePopulator populator = new EmployeePopulator(); @@ -445,7 +449,7 @@ protected static boolean compare(int i) { if(objectVectors[i] == null) { return false; } - Vector currentVector = getDbSession().readAllObjects(classes[i]); + Vector currentVector = getDbSession().readAllObjects(classes[i]); if(currentVector.size() != objectVectors[i].size()) { return false; } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/BaseFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/BaseFetchGroupTests.java index c742ce17bff..a6a4cecce8f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/BaseFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/BaseFetchGroupTests.java @@ -14,13 +14,8 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - import org.eclipse.persistence.config.CacheIsolationType; import org.eclipse.persistence.config.DescriptorCustomizer; import org.eclipse.persistence.config.QueryHints; @@ -39,12 +34,16 @@ import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; -import org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced.EmployeePopulator; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.EquipmentCode; import org.eclipse.persistence.testing.tests.jpa.fieldaccess.FetchGroupAssert; import org.eclipse.persistence.testing.tests.jpa.fieldaccess.QuerySQLTracker; +import org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced.EmployeePopulator; import org.junit.Test; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + /** * Simple set of tests that verify the {@link FetchGroup} API. Need to verify * that the nesting and default behaves as expected. @@ -487,16 +486,16 @@ public static Employee minimumEmployee(EntityManager em, Map hin } public static Employee minEmployeeWithAddressAndPhones(EntityManager em) { - return (Employee) em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.owner.id) FROM PhoneNumber p)").getSingleResult(); + return em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.owner.id) FROM PhoneNumber p)", Employee.class).getSingleResult(); } public Employee minEmployeeWithManagerWithAddress(EntityManager em) { - List emps = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.manager WHERE e.manager.address IS NOT NULL ORDER BY e.id").getResultList(); + List emps = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.manager WHERE e.manager.address IS NOT NULL ORDER BY e.id", Employee.class).getResultList(); return emps.get(0); } public static int minEmployeeIdWithAddressAndPhones(EntityManager em) { - return ((Number) em.createQuery("SELECT e.id FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.owner.id) FROM PhoneNumber p)").getSingleResult()).intValue(); + return em.createQuery("SELECT e.id FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT MIN(p.owner.id) FROM PhoneNumber p)", Number.class).getSingleResult().intValue(); } public static class PhoneCustomizer implements DescriptorCustomizer { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FAServerTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FAServerTestSuite.java index 4988af37cf7..6dc12bce989 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FAServerTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FAServerTestSuite.java @@ -14,8 +14,8 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import junit.framework.TestSuite; import junit.framework.Test; +import junit.framework.TestSuite; /** *

Purpose: To collect the tests that will run against Application Server only. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupMergeWithCacheTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupMergeWithCacheTests.java index 5f2c002299b..457be3c2b04 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupMergeWithCacheTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupMergeWithCacheTests.java @@ -14,19 +14,16 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.HashMap; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - +import junit.framework.TestSuite; import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.queries.FetchGroup; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; - import org.junit.Test; -import junit.framework.TestSuite; +import java.util.HashMap; +import java.util.Map; public class FetchGroupMergeWithCacheTests extends BaseFetchGroupTests { public FetchGroupMergeWithCacheTests() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupTrackerWeavingTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupTrackerWeavingTests.java index 102a7cbda5a..23a5d37087d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupTrackerWeavingTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/FetchGroupTrackerWeavingTests.java @@ -14,24 +14,20 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.ArrayList; -import java.util.Collection; - import junit.framework.TestSuite; - import org.eclipse.persistence.internal.jpa.weaving.ClassWeaver; import org.eclipse.persistence.queries.FetchGroup; import org.eclipse.persistence.queries.FetchGroupTracker; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; - import org.junit.Test; +import java.util.ArrayList; +import java.util.Collection; + /** diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedDefaultFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedDefaultFetchGroupTests.java index 7f05c19afde..f4f56384fe4 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedDefaultFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedDefaultFetchGroupTests.java @@ -14,15 +14,9 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.TypedQuery; - import junit.framework.TestSuite; - import org.eclipse.persistence.config.DescriptorCustomizer; import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.descriptors.ClassDescriptor; @@ -33,9 +27,12 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; - import org.junit.Test; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Test named nested FetchGroup usage. * diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedFetchGroupTests.java index 2a3e3299435..02cf9a13fc5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedFetchGroupTests.java @@ -15,16 +15,9 @@ // 09/21/2010-2.2 Frank Schwarz and ailitchev - Bug 325684 - QueryHints.BATCH combined with QueryHints.FETCH_GROUP_LOAD will cause NPE package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.IdentityHashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - import junit.framework.TestSuite; - import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.internal.helper.IdentityHashSet; import org.eclipse.persistence.internal.jpa.EntityManagerImpl; @@ -37,12 +30,16 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Department; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee.Gender; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee.Gender; - import org.junit.Test; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * @author dclarke * @since EclipseLink 2.1 diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedNamedFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedNamedFetchGroupTests.java index 4b995c2dde0..6d0f0b73d39 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedNamedFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/NestedNamedFetchGroupTests.java @@ -14,24 +14,21 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.EntityManager; -import jakarta.persistence.Query; - +import jakarta.persistence.TypedQuery; import junit.framework.TestSuite; - import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.internal.queries.AttributeItem; import org.eclipse.persistence.queries.FetchGroup; import org.eclipse.persistence.queries.FetchGroupTracker; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee.Gender; - +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; import org.junit.Test; +import java.util.ArrayList; +import java.util.List; + /** * @author dclarke * @since EclipseLink 2.1 @@ -89,7 +86,7 @@ public void dynamicFetchGroup_EmployeeAddress() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER", Employee.class); query.setParameter("GENDER", Gender.Male); // Define the fields to be fetched on Employee @@ -157,7 +154,7 @@ public void dynamicFetchGroup_EmployeeAddress() { public void dynamicFetchGroup_Employee_NullAddress() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER", Employee.class); query.setParameter("GENDER", Gender.Male); // Define the fields to be fetched on Employee @@ -222,7 +219,7 @@ public void dynamicFetchGroup_EmployeeAddressNullPhone() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER", Employee.class); query.setParameter("GENDER", Gender.Male); // Define the fields to be fetched on Employee @@ -301,7 +298,7 @@ public void dynamicFetchGroup_EmployeeAddressEmptyPhone() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER", Employee.class); query.setParameter("GENDER", Gender.Male); // Define the fields to be fetched on Employee @@ -384,7 +381,7 @@ public void dynamicHierarchicalFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.gender = :GENDER", Employee.class); query.setParameter("GENDER", Gender.Male); // Define the fields to be fetched on Employee diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleDefaultFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleDefaultFetchGroupTests.java index aaa47d398fe..809ff4ab514 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleDefaultFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleDefaultFetchGroupTests.java @@ -14,13 +14,10 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.List; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - +import jakarta.persistence.TypedQuery; import junit.framework.TestSuite; - import org.eclipse.persistence.config.DescriptorCustomizer; import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.descriptors.ClassDescriptor; @@ -28,9 +25,10 @@ import org.eclipse.persistence.queries.FetchGroupTracker; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; - import org.junit.Test; +import java.util.List; + /** * Simple tests to verify the functionality of single level FetchGroup usage * @@ -194,7 +192,7 @@ public void resultListDefaultFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); List emps = query.getResultList(); @@ -354,7 +352,7 @@ public void resultListNoFetchGroup() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); query.setHint(QueryHints.FETCH_GROUP_DEFAULT, "false"); @@ -611,7 +609,7 @@ public void joinFetchEmployeeAddressWithDynamicFetchGroup() { fetchGroup.addAttribute("lastName"); query.setHint(QueryHints.FETCH_GROUP, fetchGroup); - List emps = query.getResultList(); + List emps = query.getResultList(); assertNotNull(emps); } @@ -630,7 +628,7 @@ void internalJoinFetchEmployeeAddressPhoneWithDynamicFetchGroup(boolean addAddre try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.owner.id FROM PhoneNumber p)"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.owner.id FROM PhoneNumber p)", Employee.class); FetchGroup fetchGroup = new FetchGroup("names"); fetchGroup.addAttribute("firstName"); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleFetchGroupTests.java index 508879ea0be..b6023d191cc 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleFetchGroupTests.java @@ -14,25 +14,21 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; import jakarta.persistence.TypedQuery; - import junit.framework.TestSuite; - import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.indirection.IndirectList; import org.eclipse.persistence.queries.FetchGroup; - import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; - import org.junit.Test; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Simple tests to verify the functionality of single level FetchGroup usage * @@ -143,7 +139,7 @@ public void singleResultNoFetchGroup() { public void resultListNoFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); List emps = query.getResultList(); @@ -386,7 +382,7 @@ public void resultListEmptyFetchGroup() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); FetchGroup emptyFG = new FetchGroup(); query.setHint(QueryHints.FETCH_GROUP, emptyFG); @@ -455,7 +451,7 @@ public void resultListPeriodFetchGroup() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); FetchGroup fg = new FetchGroup(); fg.addAttribute("period"); @@ -704,7 +700,7 @@ public void joinFetchEmployeeAddressWithDynamicFetchGroup() { fetchGroup.addAttribute("lastName"); query.setHint(QueryHints.FETCH_GROUP, fetchGroup); - List emps = query.getResultList(); + List emps = query.getResultList(); assertNotNull(emps); } @@ -721,7 +717,7 @@ public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() { fetchGroup.addAttribute("lastName"); query.setHint(QueryHints.FETCH_GROUP, fetchGroup); - List emps = query.getResultList(); + List emps = query.getResultList(); assertNotNull(emps); } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleNamedFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleNamedFetchGroupTests.java index e31f2ce4a66..464802f5ee3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleNamedFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleNamedFetchGroupTests.java @@ -14,22 +14,20 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.util.List; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - +import jakarta.persistence.TypedQuery; import junit.framework.TestSuite; - import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.queries.FetchGroup; import org.eclipse.persistence.queries.FetchGroupTracker; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; - import org.junit.Test; +import java.util.List; + /** * Simple tests to verify the functionality of single level FetchGroup usage * @@ -158,7 +156,7 @@ public void singleResultDefaultFetchGroup() { public void resultListDefaultFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); List emps = query.getResultList(); @@ -233,7 +231,7 @@ public void singleResultNoFetchGroup() { public void resultListNoFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); List emps = query.getResultList(); @@ -411,7 +409,7 @@ public void joinFetchEmployeeAddressWithDynamicFetchGroup() { fetchGroup.addAttribute("lastName"); query.setHint(QueryHints.FETCH_GROUP, fetchGroup); - List emps = query.getResultList(); + List emps = query.getResultList(); assertNotNull(emps); } @@ -428,7 +426,7 @@ public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() { fetchGroup.addAttribute("lastName"); query.setHint(QueryHints.FETCH_GROUP, fetchGroup); - List emps = query.getResultList(); + List emps = query.getResultList(); assertNotNull(emps); } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleSerializeFetchGroupTests.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleSerializeFetchGroupTests.java index fcd7d300d8c..a15acef0bda 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleSerializeFetchGroupTests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/fetchgroups/SimpleSerializeFetchGroupTests.java @@ -14,21 +14,10 @@ // 05/19/2010-2.1 ailitchev - Bug 244124 - Add Nested FetchGroup package org.eclipse.persistence.testing.tests.jpa.fieldaccess.fetchgroups; -import java.io.ByteArrayInputStream; -import java.io.ObjectInputStream; -import java.io.IOException; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; import jakarta.persistence.TypedQuery; - import junit.framework.TestSuite; - import org.eclipse.persistence.config.CacheUsage; import org.eclipse.persistence.config.QueryHints; import org.eclipse.persistence.indirection.IndirectList; @@ -48,9 +37,17 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; - import org.junit.Test; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + /** * Simple tests to verify the functionality of {@link FetchGroup} when the * entities are detached through serialization. @@ -384,7 +381,7 @@ public void resultListEmptyFetchGroup() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); FetchGroup emptyFG = new FetchGroup(); query.setHint(QueryHints.FETCH_GROUP, emptyFG); @@ -453,7 +450,7 @@ public void resultListPeriodFetchGroup() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.id = :ID", Employee.class); query.setParameter("ID", minimumEmployeeId(em)); FetchGroup fg = new FetchGroup(); fg.addAttribute("period"); @@ -695,7 +692,7 @@ public void employeeNamesFetchGroup() { public void joinFetchEmployeeAddressWithDynamicFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address", Employee.class); FetchGroup fetchGroup = new FetchGroup("names"); fetchGroup.addAttribute("firstName"); @@ -712,7 +709,7 @@ public void joinFetchEmployeeAddressWithDynamicFetchGroup() { public void joinFetchEmployeeAddressPhoneWithDynamicFetchGroup() { EntityManager em = createEntityManager("fieldaccess"); - Query query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.owner.id FROM PhoneNumber p)"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e JOIN FETCH e.address WHERE e.id IN (SELECT p.owner.id FROM PhoneNumber p)", Employee.class); FetchGroup fetchGroup = new FetchGroup("names"); fetchGroup.addAttribute("firstName"); @@ -783,7 +780,7 @@ public void verifyFetchedRelationshipAttributes() { public void simpleSerializeAndMerge() throws Exception { EntityManager em = createEntityManager("fieldaccess"); int id = minEmployeeIdWithAddressAndPhones(em); - HashMap phonesOriginal = new HashMap(); + HashMap phonesOriginal = new HashMap<>(); // save the original Employee for clean up Employee empOriginal = em.find(Employee.class, id); for(PhoneNumber phone : empOriginal.getPhoneNumbers()) { @@ -1108,6 +1105,7 @@ public void copyGroupMerge2() { group.addAttribute("lastName"); group.addAttribute("address"); + @SuppressWarnings({"unchecked"}) List employeesCopy = (List) em.unwrap(JpaEntityManager.class).copy(employees, group); assertEquals(2, getQuerySQLTracker(em).getTotalSQLSELECTCalls()); System.out.println(">>> Employees copied"); @@ -1320,11 +1318,12 @@ public void copyCascadeAllParts() { copyCascade(CopyGroup.CASCADE_ALL_PARTS); } + @SuppressWarnings({"unchecked"}) void copyCascade(int cascadeDepth) { EntityManager em = createEntityManager("fieldaccess"); try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e", Employee.class); List employees = query.getResultList(); CopyGroup group = new CopyGroup(); @@ -1345,7 +1344,7 @@ void copyCascade(int cascadeDepth) { // In this case the objects should be copied one by one - each one using a new CopyGroup. // That ensures most referenced object are original ones (not copies) - // the only exception is privately owned objects in CASCADE_PRIVATE_PARTS case. - employeesCopy = new ArrayList(employees.size()); + employeesCopy = new ArrayList<>(employees.size()); for(Employee emp : employees) { CopyGroup groupClone = group.clone(); employeesCopy.add((Employee)em.unwrap(JpaEntityManager.class).copy(emp, groupClone)); @@ -1356,7 +1355,7 @@ void copyCascade(int cascadeDepth) { // That ensures identities of the copies: // for instance if several employees referenced the same project, // then all copies of these employees will reference the single copy of the project. - employeesCopy = (List)em.unwrap(JpaEntityManager.class).copy(employees, group); + employeesCopy = (List)em.unwrap(JpaEntityManager.class).copy(employees, group); } // IdentityHashSets will be used to verify copy identities @@ -1482,7 +1481,7 @@ public void attrAndVHContainSameObjectAfterGetRealAttributeValue() { try { beginTransaction(em); - Query query = em.createQuery("SELECT e FROM Employee e WHERE e.address IS NOT NULL and e.manager IS NOT NULL"); + TypedQuery query = em.createQuery("SELECT e FROM Employee e WHERE e.address IS NOT NULL and e.manager IS NOT NULL", Employee.class); List employees = query.getResultList(); OneToOneMapping addressMapping = (OneToOneMapping)employeeDescriptor.getMappingForAttributeName("address"); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer.java index 5e0bbc23fbe..58fe59d5263 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer.java @@ -14,12 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.Collection; -import java.util.HashSet; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -33,10 +27,15 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; - import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.config.CacheIsolationType; +import java.util.Collection; +import java.util.HashSet; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="FieldAccessCustomer") @Table(name="CMP3_FIELDACCESS_CUSTOMER") @NamedQuery( diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer2.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer2.java index 78fcf28f9ab..d67e0e46a3e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer2.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Customer2.java @@ -14,7 +14,12 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import jakarta.persistence.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.Version; @Entity(name="FieldAccessCustomer2") @Table(name="CMP3_FIELDACCESS_CUSTOMER2") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/IsolatedItem.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/IsolatedItem.java index a3cd570fa57..608cd674449 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/IsolatedItem.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/IsolatedItem.java @@ -14,8 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + +import static jakarta.persistence.GenerationType.TABLE; @Entity(name="FieldAccessIsolatedItem") @Table(name="CMP3_FIELDACCESS_ISOLATED_ITEM") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Item.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Item.java index 8d847f2ed0e..23d72932868 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Item.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Item.java @@ -14,8 +14,16 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Version; + +import static jakarta.persistence.GenerationType.TABLE; @Entity(name="FieldAccessItem") @Table(name="CMP3_FIELDACCESS_ITEM") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Order.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Order.java index b9f9f4e69ed..6492faac73f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Order.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/Order.java @@ -14,10 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import static jakarta.persistence.CascadeType.PERSIST; -import static jakarta.persistence.FetchType.LAZY; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -31,10 +27,13 @@ import jakarta.xml.bind.annotation.XmlAccessType; import jakarta.xml.bind.annotation.XmlAccessorType; import jakarta.xml.bind.annotation.XmlRootElement; - import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.config.CacheIsolationType; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.FetchType.LAZY; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="FieldAccessOrderBean") @Table(name="CMP3_FIELDACCESS_ORDER") @NamedQuery( diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/RelationshipsExamples.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/RelationshipsExamples.java index b9e92cd0a06..b7f954fc768 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/RelationshipsExamples.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/RelationshipsExamples.java @@ -14,11 +14,12 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import java.util.Vector; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.UnitOfWork; import org.eclipse.persistence.tools.schemaframework.PopulationManager; +import java.util.Vector; + public class RelationshipsExamples { private PopulationManager populationManager; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/SalesPerson.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/SalesPerson.java index bb0db2d5e6e..c3a45b0946f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/SalesPerson.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/fieldaccess/relationships/SalesPerson.java @@ -15,11 +15,6 @@ package org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.Collection; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -27,10 +22,14 @@ import jakarta.persistence.OneToMany; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; - import org.eclipse.persistence.annotations.Cache; import org.eclipse.persistence.config.CacheIsolationType; +import java.util.Collection; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="FieldAccessSalesPerson") @Table(name="CMP3_FIELDACCESS_SALESPERSON") @Cache(isolation=CacheIsolationType.ISOLATED) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/ExpressionJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/ExpressionJUnitTest.java index 2de4edb8933..1643eba848d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/ExpressionJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/ExpressionJUnitTest.java @@ -14,18 +14,19 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships; -import java.util.List; - import jakarta.persistence.EntityManager; - import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.internal.databaseaccess.Platform; import org.eclipse.persistence.jpa.JpaEntityManager; import org.eclipse.persistence.queries.ReadAllQuery; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.*; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.Customer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.Item; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsExamples; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsTableManager; + +import java.util.List; public class ExpressionJUnitTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/FRServerTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/FRServerTestSuite.java index d5484868ab2..9ccb42feacd 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/FRServerTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/FRServerTestSuite.java @@ -14,8 +14,8 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships; -import junit.framework.TestSuite; import junit.framework.Test; +import junit.framework.TestSuite; /** *

Purpose: To collect the tests that will run against Application Server only. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/IsolatedCacheTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/IsolatedCacheTest.java index a01f2857f60..98f8af38091 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/IsolatedCacheTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/IsolatedCacheTest.java @@ -14,16 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships; +import jakarta.persistence.EntityManager; import junit.framework.Test; import junit.framework.TestSuite; - -import jakarta.persistence.*; - import org.eclipse.persistence.internal.jpa.EntityManagerImpl; import org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - -import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.*; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.IsolatedItem; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsTableManager; public class IsolatedCacheTest extends JUnitTestCase { public IsolatedCacheTest() {} diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/JAXBTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/JAXBTest.java index ecba8dd0476..9015a44afc1 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/JAXBTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/JAXBTest.java @@ -14,9 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships; -import java.io.StringReader; -import java.io.StringWriter; - import jakarta.persistence.EntityManager; import jakarta.xml.bind.JAXBContext; import junit.framework.Test; @@ -26,6 +23,9 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.Order; import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsTableManager; +import java.io.StringReader; +import java.io.StringWriter; + /** * Tests marshaling JPA objects with lazy through JAXB. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/RelationshipModelJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/RelationshipModelJUnitTest.java index 0a3ed670a9b..7ff5b9a6ac9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/RelationshipModelJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/RelationshipModelJUnitTest.java @@ -15,18 +15,13 @@ // - 211302: Add variable 1-1 mapping support to the EclipseLink-ORM.XML Schema package org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; - import jakarta.persistence.EntityManager; import jakarta.persistence.NoResultException; import jakarta.persistence.NonUniqueResultException; import jakarta.persistence.PersistenceException; import jakarta.persistence.Query; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.exceptions.QueryException; import org.eclipse.persistence.internal.jpa.EJBQueryImpl; import org.eclipse.persistence.internal.jpa.EntityManagerImpl; @@ -43,8 +38,11 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsExamples; import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsTableManager; -import junit.framework.Test; -import junit.framework.TestSuite; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Vector; public class RelationshipModelJUnitTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/UniAndBiDirectionalMappingTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/UniAndBiDirectionalMappingTest.java index 0f3ae39e166..d911a91c73a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/UniAndBiDirectionalMappingTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.fieldaccess.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/fieldaccess/relationships/UniAndBiDirectionalMappingTest.java @@ -14,14 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.fieldaccess.relationships; -import java.util.Vector; - -import jakarta.persistence.*; - -import junit.framework.*; - -import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.*; +import jakarta.persistence.EntityManager; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.Customer; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.relationships.RelationshipsTableManager; + +import java.util.Vector; /** * Test transactional operations with uni and bi-directional relationships. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/main/java/org/eclipse/persistence/testing/models/jpa/jpaadvancedproperties/Customer.java b/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/main/java/org/eclipse/persistence/testing/models/jpa/jpaadvancedproperties/Customer.java index a81dede2c5a..afafdb057f3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/main/java/org/eclipse/persistence/testing/models/jpa/jpaadvancedproperties/Customer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/main/java/org/eclipse/persistence/testing/models/jpa/jpaadvancedproperties/Customer.java @@ -14,9 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties; -import java.util.Vector; -import java.util.HashSet; import java.util.Collection; +import java.util.HashSet; +import java.util.Vector; public class Customer implements java.io.Serializable{ private Integer customerId; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java b/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java index 70937bcd811..6238cb253ac 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.jpaadvancedproperties/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpaadvancedproperties/JPAAdvPropertiesJUnitTestCase.java @@ -16,13 +16,8 @@ package org.eclipse.persistence.testing.tests.jpa.jpaadvancedproperties; -import java.util.ArrayList; -import java.util.List; -import java.util.Vector; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.persistence.expressions.Expression; @@ -31,10 +26,14 @@ import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.Customer; -import org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.ModelExamples; import org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.JPAPropertiesRelationshipTableManager; +import org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.ModelExamples; import org.eclipse.persistence.testing.models.jpa.jpaadvancedproperties.Order; +import java.util.ArrayList; +import java.util.List; +import java.util.Vector; + /** * JUnit test case(s) for the TopLink JPAAdvPropertiesJUnitTestCase. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.jpql/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpql/datetime/JUnitJPQLDateTimeTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.jpql/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpql/datetime/JUnitJPQLDateTimeTest.java index 3c89b3a159a..645589267c2 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.jpql/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpql/datetime/JUnitJPQLDateTimeTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.jpql/src/test/java/org/eclipse/persistence/testing/tests/jpa/jpql/datetime/JUnitJPQLDateTimeTest.java @@ -14,19 +14,17 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.jpql.datetime; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.List; - import jakarta.persistence.TemporalType; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.datetime.DateTimePopulator; import org.eclipse.persistence.testing.models.jpa.datetime.DateTimeTableCreator; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.List; + //Test all kinds of combinations of date time types public class JUnitJPQLDateTimeTest extends JUnitTestCase { public JUnitJPQLDateTimeTest() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/Image.java b/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/Image.java index 6c702f7b341..175e6521a9d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/Image.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/Image.java @@ -14,14 +14,22 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.lob; -import java.io.Serializable; -import jakarta.persistence.*; - +import jakarta.persistence.Basic; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Id; +import jakarta.persistence.Lob; +import jakarta.persistence.PrimaryKeyJoinColumn; +import jakarta.persistence.SecondaryTable; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.SerializedConverter; import org.eclipse.persistence.annotations.SerializedConverters; import org.eclipse.persistence.sessions.serializers.JSONSerializer; import org.eclipse.persistence.sessions.serializers.XMLSerializer; +import java.io.Serializable; + /** * Model class used to test Lobs and Lazy Basics. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/SerializableNonEntity.java b/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/SerializableNonEntity.java index ffdfc98a7af..21aeef4c510 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/SerializableNonEntity.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/main/java/org/eclipse/persistence/testing/models/jpa/lob/SerializableNonEntity.java @@ -14,10 +14,10 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.lob; -import java.io.Serializable; - import jakarta.xml.bind.annotation.XmlRootElement; +import java.io.Serializable; + /** * This class is used to test serialization to persistent fields in other entities, * such as mapping attributes of this type to String or blob field types. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/test/java/org/eclipse/persistence/testing/tests/jpa/lob/LobJUnitTestCase.java b/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/test/java/org/eclipse/persistence/testing/tests/jpa/lob/LobJUnitTestCase.java index 1df90e5b8cb..25376fdf763 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/test/java/org/eclipse/persistence/testing/tests/jpa/lob/LobJUnitTestCase.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.lob/src/test/java/org/eclipse/persistence/testing/tests/jpa/lob/LobJUnitTestCase.java @@ -14,18 +14,18 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.lob; -import java.lang.reflect.Field; - import jakarta.persistence.EntityManager; -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.internal.helper.Helper; import org.eclipse.persistence.internal.weaving.PersistenceWeaved; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.lob.Image; import org.eclipse.persistence.testing.models.jpa.lob.ImageSimulator; import org.eclipse.persistence.testing.models.jpa.lob.LobTableCreator; import org.eclipse.persistence.testing.models.jpa.lob.SerializableNonEntity; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; + +import java.lang.reflect.Field; /** * JUnit test case(s) for the TopLink EntityMappingsXMLProcessor. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Board.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Board.java index fa599fe8eaf..fca727bfd95 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Board.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Board.java @@ -17,14 +17,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.LinkedHashSet; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -37,6 +29,14 @@ import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashSet; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="BoardMetamodel") @Table(name="CMP3_MM_BOARD") public class Board implements java.io.Serializable{ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CPUEmbeddedId.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CPUEmbeddedId.java index de22fdaa4b1..122284485f5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CPUEmbeddedId.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CPUEmbeddedId.java @@ -23,15 +23,15 @@ // package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.GenerationType.TABLE; - -import java.io.Serializable; - import jakarta.persistence.Column; import jakarta.persistence.Embeddable; import jakarta.persistence.GeneratedValue; import jakarta.persistence.TableGenerator; +import java.io.Serializable; + +import static jakarta.persistence.GenerationType.TABLE; + // This class uses MethodAttributeAccessors during reflective calls @Embeddable public class CPUEmbeddedId implements Serializable { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CompositePK.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CompositePK.java index 246fa0daaf5..850fb79f5aa 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CompositePK.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/CompositePK.java @@ -15,12 +15,12 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import java.io.Serializable; - import jakarta.persistence.Basic; import jakarta.persistence.Column; import jakarta.persistence.Embeddable; +import java.io.Serializable; + @Embeddable public class CompositePK implements Serializable { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Computer.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Computer.java index 9a3227df580..4a67ccd8378 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Computer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Computer.java @@ -17,14 +17,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -38,6 +30,14 @@ import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.GenerationType.TABLE; + // Name attribute is required so we do not have a collision with jpa.inheritance.Computer @Entity(name="ComputerMetamodel") @Table(name="CMP3_MM_COMPUTER") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Core.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Core.java index 680d2e48fae..d0c1522e742 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Core.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Core.java @@ -19,9 +19,6 @@ // during MetadataProject.addMetamodelMappedSuperclass() package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -31,6 +28,9 @@ import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.GenerationType.TABLE; + /** * Use Case: IdClass identifiers declared across multiple mappedSuperclasses in an inheritance hierarchy. * Note: The following MappedSuperclass defines 3 of 4 of the Id fields as part of the IdClass MSIdClassPK. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Corporation.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Corporation.java index 299c1a81fd8..c62c1ef211f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Corporation.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Corporation.java @@ -17,17 +17,17 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.CascadeType.ALL; - -import java.util.Collection; -import java.util.HashSet; - import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.MappedSuperclass; import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; +import java.util.Collection; +import java.util.HashSet; + +import static jakarta.persistence.CascadeType.ALL; + @MappedSuperclass @Access(AccessType.FIELD) // for 316991 public abstract class Corporation extends Person { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Designer.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Designer.java index 937c68152a8..eb68599483e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Designer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Designer.java @@ -17,15 +17,13 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; - -//import jakarta.persistence.Column; -//import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.MappedSuperclass; import jakarta.persistence.OneToOne; +import static jakarta.persistence.FetchType.EAGER; + @MappedSuperclass public abstract class Designer extends Person { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EmbeddedPK.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EmbeddedPK.java index 3f93d5ebf4a..0aafa7cdb29 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EmbeddedPK.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EmbeddedPK.java @@ -15,10 +15,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.GenerationType.TABLE; - -import java.io.Serializable; - import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.Column; @@ -26,6 +22,10 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.TableGenerator; +import java.io.Serializable; + +import static jakarta.persistence.GenerationType.TABLE; + @Embeddable @Access(AccessType.FIELD) // for 316991 public class EmbeddedPK implements Serializable { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Enclosure.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Enclosure.java index f2677a84a6f..f0c444463b9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Enclosure.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Enclosure.java @@ -15,8 +15,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; @@ -25,6 +23,8 @@ import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; +import static jakarta.persistence.FetchType.EAGER; + @Entity(name="EnclosureMetamodel") @Table(name="CMP3_MM_ENCLOSURE") @IdClass(org.eclipse.persistence.testing.models.jpa.metamodel.EnclosureIdClassPK.class) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EntityChildOfMSRootPropertyAccess.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EntityChildOfMSRootPropertyAccess.java index 4bfc1887553..4714be6a554 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EntityChildOfMSRootPropertyAccess.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/EntityChildOfMSRootPropertyAccess.java @@ -16,13 +16,13 @@ // http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_95:_20091017:_Attribute.getJavaMember.28.29_returns_null_for_a_BasicType_on_a_MappedSuperclass_because_of_an_uninitialized_accessor package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.TableGenerator; +import static jakarta.persistence.GenerationType.TABLE; + @Entity public class EntityChildOfMSRootPropertyAccess extends MSRootPropertyAccess implements java.io.Serializable { private static final long serialVersionUID = -3898581601728869378L; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Foo.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Foo.java index f6d9f3ee804..4f7a0a77bf7 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Foo.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Foo.java @@ -18,6 +18,7 @@ import jakarta.persistence.Id; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; + import java.util.List; @Entity diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/FooBarId.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/FooBarId.java index 6bdcd643e91..e3df9f848a0 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/FooBarId.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/FooBarId.java @@ -16,6 +16,7 @@ import jakarta.persistence.Column; import jakarta.persistence.Embeddable; + import java.io.Serializable; import java.util.Objects; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/GalacticPosition.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/GalacticPosition.java index 6569365d319..5adacffda3f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/GalacticPosition.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/GalacticPosition.java @@ -17,9 +17,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.InheritanceType.JOINED; - import jakarta.persistence.Access; import jakarta.persistence.AccessType; import jakarta.persistence.Column; @@ -31,6 +28,9 @@ import jakarta.persistence.Table; import jakarta.persistence.Version; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.InheritanceType.JOINED; + //OVERRIDE @Inheritance from SINGLE_TABLE to JOINED //http://wiki.eclipse.org/Introduction_to_EclipseLink_JPA_%28ELUG%29#.40Inheritance diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/HardwareDesigner.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/HardwareDesigner.java index d86c50f614a..876160c56f9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/HardwareDesigner.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/HardwareDesigner.java @@ -17,14 +17,14 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.ManyToOne; import jakarta.persistence.Table; import jakarta.persistence.Version; +import static jakarta.persistence.FetchType.EAGER; + // No name attribute for testing @Entity @Table(name="CMP3_MM_HWDESIGNER") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Manufacturer.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Manufacturer.java index b35dfffdf37..bf4175f95c9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Manufacturer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Manufacturer.java @@ -17,7 +17,14 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.CascadeType.ALL; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.MapKey; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Version; +import org.eclipse.persistence.annotations.BasicCollection; import java.math.BigDecimal; import java.math.BigInteger; @@ -28,15 +35,7 @@ import java.util.Map; import java.util.Set; -import jakarta.persistence.CascadeType; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.MapKey; -import jakarta.persistence.OneToMany; -import jakarta.persistence.Table; -import jakarta.persistence.Version; - -import org.eclipse.persistence.annotations.BasicCollection; +import static jakarta.persistence.CascadeType.ALL; // retain name attribute for testing @Entity(name="ManuMetamodel") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Memory.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Memory.java index 3bb018068de..23b1ae1f063 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Memory.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Memory.java @@ -17,9 +17,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -29,6 +26,9 @@ import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="MemoryMetamodel") @Table(name="CMP3_MM_MEMORY") public class Memory implements java.io.Serializable{ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/MultiCoreCPU.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/MultiCoreCPU.java index 473810609fa..ef8cef612f3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/MultiCoreCPU.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/MultiCoreCPU.java @@ -19,15 +19,15 @@ // during MetadataProject.addMetamodelMappedSuperclass() package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.CascadeType.ALL; - -import java.util.Set; - import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.OneToMany; import jakarta.persistence.Table; +import java.util.Set; + +import static jakarta.persistence.CascadeType.ALL; + /** * Use Case: IdClass identifiers declared across multiple mappedSuperclasses in an inheritance hierarchy. * Note: The following MappedSuperclass defines 3 of 4 of the Id fields as part of the IdClass MSIdClassPK. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Observation.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Observation.java index 0b5e4762136..60e578c9720 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Observation.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Observation.java @@ -15,14 +15,12 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import java.util.List; -import java.util.Map; - import jakarta.persistence.ElementCollection; import jakarta.persistence.Embeddable; import jakarta.persistence.Embedded; -import jakarta.persistence.ManyToMany; -import jakarta.persistence.MapKey; + +import java.util.List; +import java.util.Map; @Embeddable public class Observation { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Person.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Person.java index 5ffdf8f0f13..ecbe8f6510f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Person.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Person.java @@ -17,14 +17,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.GenerationType.TABLE; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collection; - import jakarta.persistence.Column; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; @@ -32,6 +24,14 @@ import jakarta.persistence.OneToMany; import jakarta.persistence.TableGenerator; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.GenerationType.TABLE; + //This class uses IntanceVariableAttributeAccessors during reflective calls @MappedSuperclass public class Person implements Serializable { // changed from abstract to concrete for 248780 diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Processor.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Processor.java index efba085866d..da15a3c6b0a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Processor.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/Processor.java @@ -17,12 +17,6 @@ // - 266912: JPA 2.0 Metamodel API (part of the JSR-317 EJB 3.1 Criteria API) package org.eclipse.persistence.testing.models.jpa.metamodel; -import static jakarta.persistence.FetchType.EAGER; -import static jakarta.persistence.GenerationType.TABLE; -import static jakarta.persistence.InheritanceType.JOINED; - -import java.io.Serializable; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -33,6 +27,12 @@ import jakarta.persistence.TableGenerator; import jakarta.persistence.Version; +import java.io.Serializable; + +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.GenerationType.TABLE; +import static jakarta.persistence.InheritanceType.JOINED; + // OVERRIDE @Inheritance from SINGLE_TABLE to JOINED // http://wiki.eclipse.org/Introduction_to_EclipseLink_JPA_%28ELUG%29#.40Inheritance diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/WithInner.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/WithInner.java index a54103eaa8e..6a98dd6dcb8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/WithInner.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/main/java/org/eclipse/persistence/testing/models/jpa/metamodel/WithInner.java @@ -15,14 +15,14 @@ // - 531528: IdentifiableType.hasSingleIdAttribute() returns true when IdClass references an inner class package org.eclipse.persistence.testing.models.jpa.metamodel; -import java.io.Serializable; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.IdClass; import jakarta.persistence.Table; +import java.io.Serializable; + @Entity @Table(name="INNER_PK") @IdClass(WithInner.InnerPK.class) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/EntityManagerImplTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/EntityManagerImplTest.java index 0897ed8e752..31e0dc974a8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/EntityManagerImplTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/EntityManagerImplTest.java @@ -20,7 +20,6 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.metamodel.Metamodel; - import junit.framework.Test; import junit.framework.TestSuite; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTest.java index 5d384a845d6..0756adc6928 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTest.java @@ -25,18 +25,10 @@ package org.eclipse.persistence.testing.tests.jpa.metamodel; -import java.lang.reflect.Field; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.math.BigInteger; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; - import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.metamodel.Attribute; +import jakarta.persistence.metamodel.Attribute.PersistentAttributeType; import jakarta.persistence.metamodel.Bindable; import jakarta.persistence.metamodel.CollectionAttribute; import jakarta.persistence.metamodel.EmbeddableType; @@ -48,16 +40,13 @@ import jakarta.persistence.metamodel.MappedSuperclassType; import jakarta.persistence.metamodel.Metamodel; import jakarta.persistence.metamodel.PluralAttribute; +import jakarta.persistence.metamodel.PluralAttribute.CollectionType; import jakarta.persistence.metamodel.SetAttribute; import jakarta.persistence.metamodel.SingularAttribute; import jakarta.persistence.metamodel.Type; -import jakarta.persistence.metamodel.Attribute.PersistentAttributeType; -import jakarta.persistence.metamodel.PluralAttribute.CollectionType; import jakarta.persistence.metamodel.Type.PersistenceType; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.internal.jpa.metamodel.AttributeImpl; import org.eclipse.persistence.internal.jpa.metamodel.BasicTypeImpl; @@ -101,6 +90,15 @@ import org.eclipse.persistence.testing.models.jpa.metamodel.VectorProcessor; import org.eclipse.persistence.testing.models.jpa.metamodel.WithInner; +import java.lang.reflect.Field; +import java.lang.reflect.Member; +import java.lang.reflect.Method; +import java.math.BigInteger; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; + /** * These tests verify the JPA 2.0 Metamodel API. * The framework is as follows: diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTestBase.java b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTestBase.java index 2dae711e24c..f5e8655898e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTestBase.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.metamodel/src/test/java/org/eclipse/persistence/testing/tests/jpa/metamodel/MetamodelTestBase.java @@ -16,7 +16,6 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; - import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.metamodel.MetamodelTableCreator; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Chassis.java b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Chassis.java index 8d587a3e231..6ede20e9170 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Chassis.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Chassis.java @@ -15,9 +15,6 @@ // - 249033: JPA 2.0 Orphan removal package org.eclipse.persistence.testing.models.jpa.orphanremoval; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; @@ -25,11 +22,13 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; +import java.util.ArrayList; +import java.util.List; + import static jakarta.persistence.CascadeType.DETACH; import static jakarta.persistence.CascadeType.MERGE; import static jakarta.persistence.CascadeType.PERSIST; import static jakarta.persistence.CascadeType.REFRESH; - import static jakarta.persistence.GenerationType.TABLE; @Entity(name="OR_Chassis") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Engine.java b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Engine.java index 9bba4f04c94..a2f99f95b08 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Engine.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Engine.java @@ -15,9 +15,6 @@ // - 249033: JPA 2.0 Orphan removal package org.eclipse.persistence.testing.models.jpa.orphanremoval; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; @@ -25,6 +22,9 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; +import java.util.ArrayList; +import java.util.List; + import static jakarta.persistence.CascadeType.DETACH; import static jakarta.persistence.CascadeType.MERGE; import static jakarta.persistence.CascadeType.PERSIST; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/OrphanRemovalModelTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/OrphanRemovalModelTableCreator.java index 2a1a0970e06..9ced3debf5f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/OrphanRemovalModelTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/OrphanRemovalModelTableCreator.java @@ -18,7 +18,10 @@ package org.eclipse.persistence.testing.models.jpa.orphanremoval; import org.eclipse.persistence.sessions.DatabaseSession; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.ForeignKeyConstraint; +import org.eclipse.persistence.tools.schemaframework.TableCreator; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class OrphanRemovalModelTableCreator extends TableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Tire.java b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Tire.java index 44a79c7de26..462d70520ee 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Tire.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Tire.java @@ -17,13 +17,13 @@ // - 474752: Added TireDetails package org.eclipse.persistence.testing.models.jpa.orphanremoval; -import java.util.Set; - import jakarta.persistence.Embeddable; import jakarta.persistence.FetchType; import jakarta.persistence.JoinColumn; import jakarta.persistence.OneToMany; +import java.util.Set; + @Embeddable public class Tire { protected String type; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Wheel.java b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Wheel.java index 4ec9dfb7f9a..dc65afdd29e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Wheel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/main/java/org/eclipse/persistence/testing/models/jpa/orphanremoval/Wheel.java @@ -15,9 +15,6 @@ // - 249033: JPA 2.0 Orphan removal package org.eclipse.persistence.testing.models.jpa.orphanremoval; -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Embedded; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; @@ -28,6 +25,9 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; +import java.util.ArrayList; +import java.util.List; + import static jakarta.persistence.CascadeType.ALL; import static jakarta.persistence.GenerationType.TABLE; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/test/java/org/eclipse/persistence/testing/tests/jpa/orphanremoval/OrphanRemovalJUnitTestCase.java b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/test/java/org/eclipse/persistence/testing/tests/jpa/orphanremoval/OrphanRemovalJUnitTestCase.java index c2614717fb5..ebaf6afa1bf 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/test/java/org/eclipse/persistence/testing/tests/jpa/orphanremoval/OrphanRemovalJUnitTestCase.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.orphanremoval/src/test/java/org/eclipse/persistence/testing/tests/jpa/orphanremoval/OrphanRemovalJUnitTestCase.java @@ -17,9 +17,6 @@ // - 474752: Add test for 1-M in Embeddable package org.eclipse.persistence.testing.tests.jpa.orphanremoval; -import java.util.HashSet; -import java.util.Set; - import jakarta.persistence.EntityManager; import junit.framework.Test; import junit.framework.TestSuite; @@ -35,6 +32,9 @@ import org.eclipse.persistence.testing.models.jpa.orphanremoval.WheelNut; import org.eclipse.persistence.testing.models.jpa.orphanremoval.WheelRim; +import java.util.HashSet; +import java.util.Set; + public class OrphanRemovalJUnitTestCase extends JUnitTestCase { public OrphanRemovalJUnitTestCase(String name) { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Address.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Address.java index 40f2b209602..7bf2e2007ff 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Address.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Address.java @@ -14,12 +14,18 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.io.Serializable; -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.Partitioned; import org.eclipse.persistence.annotations.Partitioning; +import java.io.Serializable; + /** *

Purpose: Represents the mailing address on an Employee *

Description: Held in a private 1:1 relationship from Employee diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Department.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Department.java index 4bb9a4dd311..cfee3a5d05c 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Department.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Department.java @@ -16,25 +16,23 @@ // - 286317: UniqueConstraint xml element is changing (plus couple other fixes, see bug) package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.io.Serializable; - -import java.util.Collection; -import java.util.Vector; - import jakarta.persistence.Column; import jakarta.persistence.Entity; -import jakarta.persistence.Id; import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinColumns; import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.HashPartitioning; import org.eclipse.persistence.annotations.Partitioned; import org.eclipse.persistence.annotations.UnionPartitioning; +import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; + import static jakarta.persistence.CascadeType.PERSIST; import static jakarta.persistence.GenerationType.TABLE; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Employee.java index c96b85c3c96..d41c24f3e6c 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Employee.java @@ -14,19 +14,39 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.util.*; -import java.io.Serializable; -import jakarta.persistence.*; - +import jakarta.persistence.CollectionTable; +import jakarta.persistence.Column; +import jakarta.persistence.ElementCollection; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.IdClass; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinColumns; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.Partitioned; -import org.eclipse.persistence.annotations.RoundRobinPartitioning; import org.eclipse.persistence.annotations.PinnedPartitioning; -import org.eclipse.persistence.annotations.ValuePartitioning; +import org.eclipse.persistence.annotations.RoundRobinPartitioning; import org.eclipse.persistence.annotations.ValuePartition; +import org.eclipse.persistence.annotations.ValuePartitioning; -import static jakarta.persistence.CascadeType.*; -import static jakarta.persistence.FetchType.*; -import static jakarta.persistence.GenerationType.*; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Vector; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.CascadeType.MERGE; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.FetchType.EAGER; +import static jakarta.persistence.FetchType.LAZY; +import static jakarta.persistence.GenerationType.TABLE; /** * Employees is partitioned by department. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePartitioningPolicy.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePartitioningPolicy.java index 76d07f8ce5d..ec4c6512c99 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePartitioningPolicy.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePartitioningPolicy.java @@ -14,14 +14,14 @@ // Oracle - initial API and implementation package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.util.List; - import org.eclipse.persistence.descriptors.partitioning.ReplicationPartitioningPolicy; import org.eclipse.persistence.internal.databaseaccess.Accessor; import org.eclipse.persistence.internal.sessions.AbstractRecord; import org.eclipse.persistence.internal.sessions.AbstractSession; import org.eclipse.persistence.queries.DatabaseQuery; +import java.util.List; + /** * Used to test a custom policy. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePopulator.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePopulator.java index 1bd64d2b73b..614daf1887a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePopulator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/EmployeePopulator.java @@ -16,12 +16,14 @@ // - 260263: SQLServer 2005/2008 requires stored procedure creation select clause variable and column name matching package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.util.*; - import jakarta.persistence.EntityManager; - import org.eclipse.persistence.tools.schemaframework.PopulationManager; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Vector; + /** *

Purpose: To build and populate the database for example and testing purposes. * This population routine is fairly complex and makes use of the population manager to diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/LargeProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/LargeProject.java index 6b383edfa36..60f9cc4f24f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/LargeProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/LargeProject.java @@ -14,7 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.partitioned; -import jakarta.persistence.*; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; /** * LargeProject subclass of Project. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Office.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Office.java index 28e9ab79eed..a0c58f62078 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Office.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Office.java @@ -18,7 +18,6 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.HashPartitioning; import org.eclipse.persistence.annotations.Partitioned; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PartitionedTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PartitionedTableCreator.java index aecf13c27df..8a6c65c853e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PartitionedTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PartitionedTableCreator.java @@ -15,7 +15,9 @@ package org.eclipse.persistence.testing.models.jpa.partitioned; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.ForeignKeyConstraint; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class PartitionedTableCreator extends TogglingFastTableCreator { public PartitionedTableCreator() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PhoneNumber.java index 9cd6041f039..cb0392ab0e3 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/PhoneNumber.java @@ -14,13 +14,20 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.io.*; - -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.IdClass; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinColumns; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; import org.eclipse.persistence.annotations.Partitioned; import org.eclipse.persistence.queries.FetchGroupTracker; +import java.io.Serializable; +import java.io.StringWriter; + /** *

* Purpose: Describes an Employee's phone number. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Project.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Project.java index f719b94a449..862b8e00af5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Project.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/Project.java @@ -14,15 +14,26 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.partitioned; -import java.io.Serializable; -import jakarta.persistence.*; - +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Inheritance; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinColumns; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.Partitioned; import org.eclipse.persistence.annotations.RangePartition; import org.eclipse.persistence.annotations.RangePartitioning; -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.InheritanceType.*; +import java.io.Serializable; + +import static jakarta.persistence.GenerationType.TABLE; +import static jakarta.persistence.InheritanceType.JOINED; /** * Employees have a many-to-many relationship with Projects through the diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/SmallProject.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/SmallProject.java index 521cb24bbcc..a3b0c558a93 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/SmallProject.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/main/java/org/eclipse/persistence/testing/models/jpa/partitioned/SmallProject.java @@ -14,7 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.partitioned; -import jakarta.persistence.*; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.Table; /** * Local interface for the small project bean. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedTest.java index ac2d41be5dd..cf31eb43302 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedTest.java @@ -14,11 +14,6 @@ // 2010-10-27 - James Sutherland (Oracle) initial impl package org.eclipse.persistence.testing.tests.jpa.partitioned; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; - import jakarta.persistence.EntityManager; import jakarta.persistence.Query; import junit.framework.Test; @@ -47,6 +42,11 @@ import org.eclipse.persistence.testing.models.jpa.partitioned.Project; import org.eclipse.persistence.tools.schemaframework.PopulationManager; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; + public class PartitionedTest extends JUnitTestCase { public static boolean validDatabase = true; public static boolean isRAC = false; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedXMLTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedXMLTest.java index 5444876b478..781f0ef7036 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedXMLTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.partitioned/src/test/java/org/eclipse/persistence/testing/tests/jpa/partitioned/PartitionedXMLTest.java @@ -14,7 +14,8 @@ // 2010-10-27 - James Sutherland (Oracle) initial impl package org.eclipse.persistence.testing.tests.jpa.partitioned; -import junit.framework.*; +import junit.framework.Test; +import junit.framework.TestSuite; public class PartitionedXMLTest extends PartitionedTest { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceServerTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceServerTestSuite.java index b11c077fe83..1ae6d8dcae9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceServerTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/JPAPerformanceServerTestSuite.java @@ -14,12 +14,13 @@ // Oracle - initial API and implementation package org.eclipse.persistence.testing.tests.jpa.performance; -import junit.framework.TestSuite; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.Persistence; import junit.framework.Test; -import org.eclipse.persistence.testing.framework.*; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import junit.framework.TestSuite; import org.eclipse.persistence.jpa.JpaEntityManagerFactory; -import jakarta.persistence.*; +import org.eclipse.persistence.testing.framework.TestExecutor; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; /** *

Purpose: Run performance tests inside JEE server. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/TopLinkJPAPerformanceRegressionModel.java b/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/TopLinkJPAPerformanceRegressionModel.java index 327c6eec5bb..38f95e6ee52 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/TopLinkJPAPerformanceRegressionModel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.performance/src/test/java/org/eclipse/persistence/testing/tests/jpa/performance/TopLinkJPAPerformanceRegressionModel.java @@ -14,12 +14,12 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.performance; -import java.util.HashMap; -import java.util.Map; import jakarta.persistence.spi.PersistenceProvider; - import org.eclipse.persistence.testing.framework.TestProblemException; +import java.util.HashMap; +import java.util.Map; + /** * Performance tests that compare JPA performance. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Chassis.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Chassis.java index e400ab55442..876e49c76ba 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Chassis.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Chassis.java @@ -14,10 +14,19 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import java.util.*; -import jakarta.persistence.*; - -import org.eclipse.persistence.annotations.*; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import org.eclipse.persistence.annotations.DeleteAll; +import org.eclipse.persistence.annotations.PrivateOwned; + +import java.util.ArrayList; +import java.util.List; @Entity(name="PO_Chassis") @Table(name="CMP3_PO_CHASSIS") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Engine.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Engine.java index f88f76be688..7caf8dff544 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Engine.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Engine.java @@ -14,10 +14,19 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import java.util.*; -import jakarta.persistence.*; - -import org.eclipse.persistence.annotations.*; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Version; +import org.eclipse.persistence.annotations.PrivateOwned; + +import java.util.ArrayList; +import java.util.List; @Entity(name="PO_Engine") @Table(name="CMP3_PO_ENGINE") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Mount.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Mount.java index f7bdacb019f..11c409679f8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Mount.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Mount.java @@ -21,8 +21,8 @@ import jakarta.persistence.Id; import jakarta.persistence.IdClass; import jakarta.persistence.JoinColumn; -import jakarta.persistence.OneToOne; import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/PrivateOwnedModelTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/PrivateOwnedModelTableCreator.java index 3422389ee3e..1d0080f50df 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/PrivateOwnedModelTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/PrivateOwnedModelTableCreator.java @@ -15,7 +15,10 @@ package org.eclipse.persistence.testing.models.jpa.privateowned; import org.eclipse.persistence.sessions.DatabaseSession; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.ForeignKeyConstraint; +import org.eclipse.persistence.tools.schemaframework.TableCreator; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class PrivateOwnedModelTableCreator extends TableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/SparkPlug.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/SparkPlug.java index bb75597ca6e..5ad78aca076 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/SparkPlug.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/SparkPlug.java @@ -14,7 +14,14 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import jakarta.persistence.*; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Version; @Entity(name="PO_SparkPlug") @Table(name="CMP3_PO_SPARK_PLUG") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Tire.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Tire.java index 116bd588827..2d5ed7f788b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Tire.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Tire.java @@ -14,7 +14,7 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import jakarta.persistence.*; +import jakarta.persistence.Embeddable; @Embeddable public class Tire { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Vehicle.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Vehicle.java index a22eb6c2108..4e59096bdd1 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Vehicle.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Vehicle.java @@ -14,8 +14,18 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import jakarta.persistence.*; - +import jakarta.persistence.CascadeType; +import jakarta.persistence.DiscriminatorValue; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Inheritance; +import jakarta.persistence.InheritanceType; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; import org.eclipse.persistence.annotations.PrivateOwned; @Entity(name="PO_Vehicle") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Wheel.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Wheel.java index 149c20b4d02..05e59aed114 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Wheel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/Wheel.java @@ -14,9 +14,20 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import jakarta.persistence.*; - -import java.util.*; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + +import java.util.ArrayList; +import java.util.List; @Entity(name="PO_Wheel") @Table(name="CMP3_PO_WHEEL") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelNut.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelNut.java index eae0bd69e8d..4aba808666b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelNut.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelNut.java @@ -14,7 +14,13 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import jakarta.persistence.*; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; @Entity(name="PO_WheelNut") @Table(name="CMP3_PO_WHEEL_NUT") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelRim.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelRim.java index f23e5ac26b2..8ee8e8538e7 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelRim.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/main/java/org/eclipse/persistence/testing/models/jpa/privateowned/WheelRim.java @@ -14,7 +14,12 @@ // 02/19/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.models.jpa.privateowned; -import jakarta.persistence.*; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; @Entity(name="PO_WheelRim") @Table(name="CMP3_PO_WHEEL_RIM") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/test/java/org/eclipse/persistence/testing/tests/jpa/privateowned/PrivateOwnedJUnitTestCase.java b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/test/java/org/eclipse/persistence/testing/tests/jpa/privateowned/PrivateOwnedJUnitTestCase.java index 4b42cf6b3b4..ecfe93403bb 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/test/java/org/eclipse/persistence/testing/tests/jpa/privateowned/PrivateOwnedJUnitTestCase.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.privateowned/src/test/java/org/eclipse/persistence/testing/tests/jpa/privateowned/PrivateOwnedJUnitTestCase.java @@ -14,20 +14,29 @@ // 03/04/09 dminsky - initial API and implementation package org.eclipse.persistence.testing.tests.jpa.privateowned; -import java.util.Iterator; - -import jakarta.persistence.*; - -import junit.framework.*; - -import org.eclipse.persistence.testing.framework.QuerySQLTracker; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.privateowned.*; - +import jakarta.persistence.EntityManager; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.mappings.CollectionMapping; import org.eclipse.persistence.sessions.UnitOfWork; import org.eclipse.persistence.sessions.server.ServerSession; +import org.eclipse.persistence.testing.framework.QuerySQLTracker; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.privateowned.Chassis; +import org.eclipse.persistence.testing.models.jpa.privateowned.Engine; +import org.eclipse.persistence.testing.models.jpa.privateowned.Mount; +import org.eclipse.persistence.testing.models.jpa.privateowned.MountPK; +import org.eclipse.persistence.testing.models.jpa.privateowned.PrivateOwnedModelTableCreator; +import org.eclipse.persistence.testing.models.jpa.privateowned.SparkPlug; +import org.eclipse.persistence.testing.models.jpa.privateowned.SpecificVehicle; +import org.eclipse.persistence.testing.models.jpa.privateowned.Tire; +import org.eclipse.persistence.testing.models.jpa.privateowned.Vehicle; +import org.eclipse.persistence.testing.models.jpa.privateowned.Wheel; +import org.eclipse.persistence.testing.models.jpa.privateowned.WheelNut; +import org.eclipse.persistence.testing.models.jpa.privateowned.WheelRim; + +import java.util.Iterator; public class PrivateOwnedJUnitTestCase extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Auditor.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Auditor.java index b7ead0e11b9..c73fd4237a4 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Auditor.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Auditor.java @@ -14,12 +14,17 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships; -import java.util.HashSet; -import java.util.Collection; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; -import jakarta.persistence.*; +import java.util.Collection; +import java.util.HashSet; -import static jakarta.persistence.GenerationType.*; +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="JPA_AUDITOR") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Customer.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Customer.java index b2f5db305c6..221c9fce3aa 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Customer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Customer.java @@ -14,15 +14,30 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.MapKeyClass; +import jakarta.persistence.NamedNativeQueries; +import jakarta.persistence.NamedNativeQuery; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Version; + +import java.util.Collection; import java.util.HashMap; import java.util.HashSet; -import java.util.Collection; import java.util.Map; -import jakarta.persistence.*; - -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.CascadeType.*; +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="CMP3_CUSTOMER") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/CustomerServiceRepresentative.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/CustomerServiceRepresentative.java index f27053655cb..dbd1afb61a7 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/CustomerServiceRepresentative.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/CustomerServiceRepresentative.java @@ -14,17 +14,17 @@ // tware - bug 282571 testing of ManyToMany Map with Entity key and Entity value package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.CascadeType.ALL; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.ArrayList; -import java.util.List; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; import jakarta.persistence.ManyToMany; import jakarta.persistence.Table; -import jakarta.persistence.Id; + +import java.util.ArrayList; +import java.util.List; + +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="CMP3_CUSTOMER_SERVICE_REP") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/IsolatedItem.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/IsolatedItem.java index 07cef647b4c..0b65cce218b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/IsolatedItem.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/IsolatedItem.java @@ -14,8 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="CMP3_ISOLATED_ITEM") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Item.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Item.java index 29559b36ba7..0771b6ff01a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Item.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Item.java @@ -18,13 +18,21 @@ // - 333488: Serializable attribute being defaulted to a variable one to one mapping and causing exception package org.eclipse.persistence.testing.models.jpa.relationships; -import java.io.Serializable; - -import jakarta.persistence.*; - -import org.eclipse.persistence.annotations.VariableOneToOne; +import jakarta.persistence.Column; +import jakarta.persistence.DiscriminatorColumn; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.DiscriminatorClass; import org.eclipse.persistence.annotations.InstantiationCopyPolicy; +import org.eclipse.persistence.annotations.VariableOneToOne; + +import java.io.Serializable; import static jakarta.persistence.CascadeType.PERSIST; import static jakarta.persistence.DiscriminatorType.INTEGER; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Lego.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Lego.java index 343fdee2bd5..12aac437517 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Lego.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Lego.java @@ -15,14 +15,14 @@ // - 211302: Add variable 1-1 mapping support to the EclipseLink-ORM.XML Schema package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="CMP3_LEGO") public class Lego implements Manufacturer { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Mattel.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Mattel.java index d91336a6015..d30c9282405 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Mattel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Mattel.java @@ -17,18 +17,17 @@ // - 251554: ExcludeDefaultMapping annotation needed package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.GenerationType.TABLE; - -import java.util.List; - import jakarta.persistence.Basic; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.ExcludeDefaultMappings; +import java.util.List; + +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="CMP3_MATTEL") @ExcludeDefaultMappings diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MegaBrands.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MegaBrands.java index 5bf59a073cb..d0f94692c63 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MegaBrands.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MegaBrands.java @@ -15,14 +15,14 @@ // - 211302: Add variable 1-1 mapping support to the EclipseLink-ORM.XML Schema package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="CMP3_MEGABRANDS") public class MegaBrands implements Distributor { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MtoMEntityA.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MtoMEntityA.java index 2acc8ff2e2d..dd32f82ba83 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MtoMEntityA.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/MtoMEntityA.java @@ -16,9 +16,6 @@ // - 438177: Test M2M map package org.eclipse.persistence.testing.models.jpa.relationships; -import java.util.HashMap; -import java.util.Map; - import jakarta.persistence.Cacheable; import jakarta.persistence.Entity; import jakarta.persistence.Id; @@ -26,6 +23,9 @@ import jakarta.persistence.ManyToMany; import jakarta.persistence.Table; +import java.util.HashMap; +import java.util.Map; + @Entity @Table(name="MTOMENTITYA") @Cacheable(false) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Namco.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Namco.java index 8f08d43dc4e..a8a8eb3404e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Namco.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Namco.java @@ -15,16 +15,15 @@ // - 211302: Add variable 1-1 mapping support to the EclipseLink-ORM.XML Schema package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; import jakarta.persistence.Table; - import org.eclipse.persistence.annotations.CloneCopyPolicy; +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="CMP3_NAMCO") @CloneCopyPolicy(method="cloneNamco", workingCopyMethod="cloneWorkingCopyNamco") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Order.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Order.java index 2fbe90f4028..c35376f5df8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Order.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/Order.java @@ -14,13 +14,25 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.CascadeType.*; -import static jakarta.persistence.FetchType.*; - +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.NamedNativeQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; +import jakarta.persistence.Version; import org.eclipse.persistence.annotations.CopyPolicy; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.FetchType.LAZY; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="OrderBean") @Table(name="CMP3_ORDER") @CopyPolicy(org.eclipse.persistence.testing.models.jpa.relationships.TestInstantiationCopyPolicy.class) diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderCard.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderCard.java index 685f80ba4b4..0537fd46628 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderCard.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderCard.java @@ -14,8 +14,6 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.Id; @@ -24,6 +22,8 @@ import jakarta.persistence.Table; import jakarta.persistence.TableGenerator; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="OrderCard") @Table(name="JPA_ORDER_CARD") public class OrderCard implements java.io.Serializable { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderLabel.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderLabel.java index 88dfdfe5dbf..d87bba63cb1 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderLabel.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/OrderLabel.java @@ -14,8 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + +import static jakarta.persistence.GenerationType.TABLE; @Entity(name="OrderLabel") @Table(name="JPA_ORDER_LABEL") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/RelationshipsExamples.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/RelationshipsExamples.java index f1ebba11ff7..dc386b3d752 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/RelationshipsExamples.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/RelationshipsExamples.java @@ -15,11 +15,12 @@ package org.eclipse.persistence.testing.models.jpa.relationships; -import java.util.ArrayList; -import java.util.List; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.UnitOfWork; +import java.util.ArrayList; +import java.util.List; + public class RelationshipsExamples { public void buildExamples(Session session) { List allObjects = new ArrayList<>(); diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/SalesPerson.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/SalesPerson.java index 1d3d7f30abd..3230cacc110 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/SalesPerson.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/SalesPerson.java @@ -15,11 +15,19 @@ package org.eclipse.persistence.testing.models.jpa.relationships; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.CascadeType.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + import java.util.Collection; +import static jakarta.persistence.CascadeType.ALL; +import static jakarta.persistence.GenerationType.TABLE; + @Entity(name="SalesPerson") @Table(name="CMP3_SALESPERSON") public class SalesPerson diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/ServiceCall.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/ServiceCall.java index 8300ae0f4a9..db9120d6439 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/ServiceCall.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/ServiceCall.java @@ -14,12 +14,12 @@ // tware - bug 282571 testing of ManyToMany Map with Entity key and Entity value package org.eclipse.persistence.testing.models.jpa.relationships; -import static jakarta.persistence.GenerationType.TABLE; - import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.Table; import jakarta.persistence.Id; +import jakarta.persistence.Table; + +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="CMP3_SERVICE_CALL") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityA.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityA.java index ad6d01105b5..bff1a08992d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityA.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityA.java @@ -14,14 +14,22 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships.manyToMany; -import static jakarta.persistence.CascadeType.*; -import static jakarta.persistence.GenerationType.TABLE; - -import jakarta.persistence.*; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; import java.util.Collection; import java.util.HashSet; +import static jakarta.persistence.CascadeType.MERGE; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="CMP3_ENTITYA") public class EntityA diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityB.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityB.java index 01ecbece84b..ffdb5c5a2e6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityB.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityB.java @@ -14,14 +14,19 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.relationships.manyToMany; -import static jakarta.persistence.CascadeType.*; -import static jakarta.persistence.GenerationType.TABLE; - -import jakarta.persistence.*; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.ManyToMany; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; import java.util.Collection; import java.util.HashSet; +import static jakarta.persistence.CascadeType.REMOVE; +import static jakarta.persistence.GenerationType.TABLE; + @Entity @Table(name="CMP3_ENTITYB") public class EntityB diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityC.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityC.java index 500a8a15b39..bc19523e5ad 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityC.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityC.java @@ -15,13 +15,14 @@ package org.eclipse.persistence.testing.models.jpa.relationships.manyToMany; import jakarta.persistence.Entity; -import jakarta.persistence.Table; -import jakarta.persistence.Id; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.TableGenerator; -import jakarta.persistence.JoinTable; -import jakarta.persistence.JoinColumn; import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.JoinTable; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + import java.util.Collection; import java.util.HashSet; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityD.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityD.java index a3babce9957..7eaff47f0b6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityD.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/relationships/manyToMany/EntityD.java @@ -15,11 +15,11 @@ package org.eclipse.persistence.testing.models.jpa.relationships.manyToMany; import jakarta.persistence.Entity; -import jakarta.persistence.Table; -import jakarta.persistence.Id; import jakarta.persistence.GeneratedValue; -import jakarta.persistence.TableGenerator; import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; @Entity @Table(name="CMP3_ENTITYD") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/OneToOneVirtualAttributeHolder.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/OneToOneVirtualAttributeHolder.java index 6177ab9233a..2683e094c7c 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/OneToOneVirtualAttributeHolder.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/OneToOneVirtualAttributeHolder.java @@ -15,12 +15,20 @@ package org.eclipse.persistence.testing.models.jpa.virtualattribute; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.OneToOne; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + import java.util.HashMap; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; -import static jakarta.persistence.CascadeType.*; -import static jakarta.persistence.FetchType.*; +import static jakarta.persistence.CascadeType.PERSIST; +import static jakarta.persistence.FetchType.LAZY; +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="O_O_VIRTUAL") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttribute.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttribute.java index 128d5dd6b09..b7d4cec58ff 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttribute.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttribute.java @@ -15,8 +15,14 @@ package org.eclipse.persistence.testing.models.jpa.virtualattribute; -import jakarta.persistence.*; -import static jakarta.persistence.GenerationType.*; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.TableGenerator; + +import static jakarta.persistence.GenerationType.TABLE; @Entity @Table(name="CMP3_VIRTUAL") diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttributeTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttributeTableCreator.java index 89d8b427df5..c9944bbc2dc 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttributeTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/main/java/org/eclipse/persistence/testing/models/jpa/virtualattribute/VirtualAttributeTableCreator.java @@ -15,7 +15,8 @@ package org.eclipse.persistence.testing.models.jpa.virtualattribute; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class VirtualAttributeTableCreator extends org.eclipse.persistence.tools.schemaframework.TableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/EMQueryTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/EMQueryTest.java index 8e37f860586..54b8c409804 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/EMQueryTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/EMQueryTest.java @@ -17,21 +17,19 @@ package org.eclipse.persistence.testing.tests.jpa.relationships; -import java.util.Collection; -import java.util.List; - import jakarta.persistence.EntityManager; - -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import jakarta.persistence.EntityNotFoundException; - -import org.eclipse.persistence.testing.models.jpa.relationships.*; -import org.eclipse.persistence.exceptions.DatabaseException; - import jakarta.persistence.Query; - import junit.framework.Test; import junit.framework.TestSuite; +import org.eclipse.persistence.exceptions.DatabaseException; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.relationships.Customer; +import org.eclipse.persistence.testing.models.jpa.relationships.Order; +import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; + +import java.util.Collection; +import java.util.List; public class EMQueryTest extends JUnitTestCase { protected Integer nonExistingCustomerId = 999999; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/ExpressionTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/ExpressionTest.java index 1f297fc5718..9cdfb42c2d0 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/ExpressionTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/ExpressionTest.java @@ -15,20 +15,20 @@ package org.eclipse.persistence.testing.tests.jpa.relationships; -import java.util.Vector; - import jakarta.persistence.EntityManager; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.internal.databaseaccess.Platform; import org.eclipse.persistence.queries.ReadAllQuery; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.relationships.Customer; +import org.eclipse.persistence.testing.models.jpa.relationships.Item; +import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples; +import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; -import org.eclipse.persistence.testing.models.jpa.relationships.*; +import java.util.Vector; public class ExpressionTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/IsolatedTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/IsolatedTest.java index a8c267c2ab1..7aeb5f6cb90 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/IsolatedTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/IsolatedTest.java @@ -14,16 +14,14 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.relationships; +import jakarta.persistence.EntityManager; import junit.framework.Test; import junit.framework.TestSuite; - -import jakarta.persistence.*; - import org.eclipse.persistence.internal.jpa.EntityManagerImpl; import org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; - -import org.eclipse.persistence.testing.models.jpa.relationships.*; +import org.eclipse.persistence.testing.models.jpa.relationships.IsolatedItem; +import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; public class IsolatedTest extends JUnitTestCase { public IsolatedTest() {} diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/KeyTypeToManyRelationshipTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/KeyTypeToManyRelationshipTest.java index 2f0b1a6417f..550483e452c 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/KeyTypeToManyRelationshipTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/KeyTypeToManyRelationshipTest.java @@ -16,18 +16,16 @@ // - 438177: Test M2M map package org.eclipse.persistence.testing.tests.jpa.relationships; -import java.util.HashMap; - import jakarta.persistence.EntityManager; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.relationships.MtoMEntityA; import org.eclipse.persistence.testing.models.jpa.relationships.MtoMEntityB; import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; +import java.util.HashMap; + public class KeyTypeToManyRelationshipTest extends JUnitTestCase{ public KeyTypeToManyRelationshipTest() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipModelTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipModelTest.java index 27839152b7d..d551b155c9a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipModelTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipModelTest.java @@ -17,56 +17,53 @@ // - 251554: ExcludeDefaultMapping annotation needed package org.eclipse.persistence.testing.tests.jpa.relationships; -import java.util.Iterator; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Vector; - import jakarta.persistence.EntityManager; import jakarta.persistence.NoResultException; import jakarta.persistence.NonUniqueResultException; import jakarta.persistence.PersistenceException; import jakarta.persistence.Query; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.descriptors.copying.CloneCopyPolicy; import org.eclipse.persistence.descriptors.copying.CopyPolicy; import org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy; +import org.eclipse.persistence.exceptions.QueryException; +import org.eclipse.persistence.internal.jpa.EJBQueryImpl; import org.eclipse.persistence.internal.jpa.EntityManagerImpl; +import org.eclipse.persistence.internal.queries.MapContainerPolicy; import org.eclipse.persistence.internal.sessions.CollectionChangeRecord; +import org.eclipse.persistence.internal.sessions.ObjectChangeSet; import org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork; import org.eclipse.persistence.internal.sessions.UnitOfWorkChangeSet; import org.eclipse.persistence.jpa.JpaHelper; -import org.eclipse.persistence.internal.sessions.ObjectChangeSet; -import org.eclipse.persistence.exceptions.QueryException; -import org.eclipse.persistence.internal.jpa.EJBQueryImpl; -import org.eclipse.persistence.internal.queries.MapContainerPolicy; import org.eclipse.persistence.queries.ReadAllQuery; import org.eclipse.persistence.queries.ReadObjectQuery; import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.relationships.Auditor; +import org.eclipse.persistence.testing.models.jpa.relationships.Customer; import org.eclipse.persistence.testing.models.jpa.relationships.CustomerCollection; import org.eclipse.persistence.testing.models.jpa.relationships.CustomerServiceRepresentative; -import org.eclipse.persistence.testing.models.jpa.relationships.Lego; import org.eclipse.persistence.testing.models.jpa.relationships.Item; +import org.eclipse.persistence.testing.models.jpa.relationships.Lego; import org.eclipse.persistence.testing.models.jpa.relationships.Mattel; import org.eclipse.persistence.testing.models.jpa.relationships.MegaBrands; import org.eclipse.persistence.testing.models.jpa.relationships.Namco; +import org.eclipse.persistence.testing.models.jpa.relationships.Order; import org.eclipse.persistence.testing.models.jpa.relationships.OrderCard; import org.eclipse.persistence.testing.models.jpa.relationships.OrderLabel; import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples; import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; -import org.eclipse.persistence.testing.models.jpa.relationships.Order; import org.eclipse.persistence.testing.models.jpa.relationships.ServiceCall; import org.eclipse.persistence.testing.models.jpa.relationships.TestInstantiationCopyPolicy; -import org.eclipse.persistence.testing.models.jpa.relationships.Customer; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Vector; public class RelationshipModelTest extends JUnitTestCase { private static Integer itemId; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipsServerTestSuite.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipsServerTestSuite.java index 955314c3c80..4e6ddfe07c6 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipsServerTestSuite.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/RelationshipsServerTestSuite.java @@ -14,8 +14,8 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.relationships; -import junit.framework.TestSuite; import junit.framework.Test; +import junit.framework.TestSuite; /** *

Purpose: To collect the tests that will run against server only. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/UniAndBiDirectionalMappingTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/UniAndBiDirectionalMappingTest.java index 917b1c9b84f..2532ba88054 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/UniAndBiDirectionalMappingTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/UniAndBiDirectionalMappingTest.java @@ -14,12 +14,13 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.relationships; -import jakarta.persistence.*; - -import junit.framework.*; - -import org.eclipse.persistence.testing.models.jpa.relationships.*; +import jakarta.persistence.EntityManager; +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.relationships.Customer; +import org.eclipse.persistence.testing.models.jpa.relationships.CustomerCollection; +import org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager; /** * Test transactional operations with uni and bi-directional relationships. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/VirtualAttributeTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/VirtualAttributeTest.java index b62a3613e84..9431d0c880b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/VirtualAttributeTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.relationships/src/test/java/org/eclipse/persistence/testing/tests/jpa/relationships/VirtualAttributeTest.java @@ -15,11 +15,12 @@ package org.eclipse.persistence.testing.tests.jpa.relationships; import jakarta.persistence.EntityManager; - -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.virtualattribute.*; +import org.eclipse.persistence.testing.models.jpa.virtualattribute.OneToOneVirtualAttributeHolder; +import org.eclipse.persistence.testing.models.jpa.virtualattribute.VirtualAttribute; +import org.eclipse.persistence.testing.models.jpa.virtualattribute.VirtualAttributeTableCreator; public class VirtualAttributeTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.remote/src/test/java/org.eclipse.persistence.testing.tests.jpa.remote/RemoteEntityManagerTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.remote/src/test/java/org.eclipse.persistence.testing.tests.jpa.remote/RemoteEntityManagerTest.java index d955f492870..2f2abf3f124 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.remote/src/test/java/org.eclipse.persistence.testing.tests.jpa.remote/RemoteEntityManagerTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.remote/src/test/java/org.eclipse.persistence.testing.tests.jpa.remote/RemoteEntityManagerTest.java @@ -16,18 +16,17 @@ // 304650: fix left over entity data interfering with testSetRollbackOnly package org.eclipse.persistence.testing.tests.jpa.remote; +import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.persistence.config.PersistenceUnitProperties; +import org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced.EntityManagerJUnitTest; + import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; - -import junit.framework.*; - -import org.eclipse.persistence.config.PersistenceUnitProperties; -import org.eclipse.persistence.testing.tests.jpa.fieldaccess.advanced.EntityManagerJUnitTest; - /** * Test the EntityManager API using a remote EntityManager. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeService.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeService.java index 7f9c4a842a5..08f8791bff9 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeService.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeService.java @@ -14,10 +14,10 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.sessionbean.ha; -import java.util.List; - import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import java.util.List; + /** * EmployeeService session bean interface. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeServiceBean.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeServiceBean.java index e0c715cdeb9..3d63e393351 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeServiceBean.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/ha/EmployeeServiceBean.java @@ -14,17 +14,15 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.sessionbean.ha; -import java.util.List; - import jakarta.ejb.Remote; import jakarta.ejb.Stateless; - import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; - import jakarta.persistence.TypedQuery; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import java.util.List; + /** * EmployeeService session bean. */ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/FindAllThread.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/FindAllThread.java index 8e8da6459ec..047b33c992b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/FindAllThread.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/FindAllThread.java @@ -14,15 +14,15 @@ // etang - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.sessionbean.ha; -import java.util.Iterator; -import java.util.List; -import java.util.Properties; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.sessionbean.ha.EmployeeService; + import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NameNotFoundException; - -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; -import org.eclipse.persistence.testing.models.jpa.sessionbean.ha.EmployeeService; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; /** * EJB 3 SessionBean tests using EclipseLink JPA diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanHATests.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanHATests.java index b514965d939..59a30884737 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanHATests.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanHATests.java @@ -14,25 +14,33 @@ // etang - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.sessionbean.ha; +import jakarta.persistence.EntityManager; +import junit.framework.Test; +import junit.framework.TestSuite; +import org.eclipse.persistence.internal.helper.Helper; +import org.eclipse.persistence.sessions.server.ServerSession; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Department; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.EmploymentPeriod; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.FormerEmployment; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.LargeProject; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.PhoneNumber; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Project; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.SmallProject; +import org.eclipse.persistence.testing.models.jpa.sessionbean.ha.EmployeeService; + +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NameNotFoundException; import java.sql.Date; import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Properties; import java.util.Vector; -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NameNotFoundException; - -import junit.framework.*; - -import jakarta.persistence.EntityManager; - -import org.eclipse.persistence.internal.helper.Helper; -import org.eclipse.persistence.sessions.server.ServerSession; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.*; -import org.eclipse.persistence.testing.models.jpa.sessionbean.ha.EmployeeService; /** * EJB 3 SessionBean tests using EclipseLink JPA diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTest.java index ed9a7285bf5..ff34004e81b 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTest.java @@ -14,18 +14,8 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.sessionbean.ha; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Address; @@ -34,6 +24,14 @@ import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.sessionbean.ha.EmployeeService; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + /** * EJB 3 SessionBean tests. Testing using EclipseLink JPA in a JEE EJB 3 * SessionBean environment. These tests can only be run with a server. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTestsRCM.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTestsRCM.java index 3387d10fb63..409e04b116f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTestsRCM.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean.ha/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/ha/SessionBeanTestsRCM.java @@ -14,21 +14,21 @@ // pvijayaratnam - cache coordination test implementation package org.eclipse.persistence.testing.tests.jpa.sessionbean.ha; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; -import java.util.Properties; -import javax.naming.Context; -import javax.naming.InitialContext; import jakarta.persistence.EntityManager; - -import junit.framework.*; - +import junit.framework.Test; +import junit.framework.TestSuite; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; -import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.AdvancedTableCreator; +import org.eclipse.persistence.testing.models.jpa.fieldaccess.advanced.Employee; import org.eclipse.persistence.testing.models.jpa.sessionbean.ha.EmployeeService; +import javax.naming.Context; +import javax.naming.InitialContext; +import java.net.URL; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + /** * JPA Cache Coordination SessionBean tests. * Testing using EclipseLink JPA in a JEE EJB 3 SessionBean environment. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/attributeconverter/AttributeConverter.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/attributeconverter/AttributeConverter.java index 9a86c9f0829..7cc42f3245f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/attributeconverter/AttributeConverter.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/attributeconverter/AttributeConverter.java @@ -16,7 +16,6 @@ import jakarta.annotation.PreDestroy; import jakarta.inject.Inject; import jakarta.persistence.Converter; - import org.eclipse.persistence.testing.models.jpa.sessionbean.InjectedBean; @Converter diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/entitylistener/AbstractEntityListener.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/entitylistener/AbstractEntityListener.java index 48046e3e3c1..efa6496eb7f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/entitylistener/AbstractEntityListener.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/entitylistener/AbstractEntityListener.java @@ -12,13 +12,12 @@ package org.eclipse.persistence.testing.models.jpa.entitylistener; -import org.eclipse.persistence.testing.models.jpa.sessionbean.InjectedBean; - import jakarta.annotation.PostConstruct; import jakarta.annotation.PreDestroy; import jakarta.inject.Inject; import jakarta.persistence.PostPersist; import jakarta.persistence.PrePersist; +import org.eclipse.persistence.testing.models.jpa.sessionbean.InjectedBean; /* Trigger Bug #495587 */ public class AbstractEntityListener { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/AttributeConverterTestBean.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/AttributeConverterTestBean.java index d3a9e2e2e4b..1f86c7b8060 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/AttributeConverterTestBean.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/AttributeConverterTestBean.java @@ -12,14 +12,13 @@ package org.eclipse.persistence.testing.models.jpa.sessionbean; -import org.eclipse.persistence.jpa.JpaEntityManagerFactory; -import org.eclipse.persistence.testing.models.jpa.attributeconverter.AttributeConverter; -import org.eclipse.persistence.testing.models.jpa.attributeconverter.AttributeConverterHolder; - import jakarta.ejb.Stateless; import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.PersistenceUnit; +import org.eclipse.persistence.jpa.JpaEntityManagerFactory; +import org.eclipse.persistence.testing.models.jpa.attributeconverter.AttributeConverter; +import org.eclipse.persistence.testing.models.jpa.attributeconverter.AttributeConverterHolder; @Stateless public class AttributeConverterTestBean implements InjectionTest { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/EntityListenerTestBean.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/EntityListenerTestBean.java index 3b7a5dd4f9f..199c3f92713 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/EntityListenerTestBean.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/main/java/org/eclipse/persistence/testing/models/jpa/sessionbean/EntityListenerTestBean.java @@ -18,7 +18,6 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.PersistenceUnit; - import org.eclipse.persistence.jpa.JpaEntityManagerFactory; import org.eclipse.persistence.testing.models.jpa.entitylistener.EntityListener; import org.eclipse.persistence.testing.models.jpa.entitylistener.EntityListenerHolder; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/AttributeConverterInjectionTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/AttributeConverterInjectionTest.java index 70647b936cb..e07e054229f 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/AttributeConverterInjectionTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/AttributeConverterInjectionTest.java @@ -12,20 +12,18 @@ package org.eclipse.persistence.testing.tests.jpa.sessionbean; -import java.util.Arrays; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.attributeconverter.AttributeConverterTableCreator; import org.eclipse.persistence.testing.models.jpa.sessionbean.InjectionTest; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Properties; + public class AttributeConverterInjectionTest extends JUnitTestCase { protected InjectionTest attributeConverterTest; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/EntityListenerInjectionTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/EntityListenerInjectionTest.java index c287de57e2a..4f0ece58d7d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/EntityListenerInjectionTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.sessionbean/src/test/java/org/eclipse/persistence/testing/tests/jpa/sessionbean/EntityListenerInjectionTest.java @@ -12,21 +12,19 @@ package org.eclipse.persistence.testing.tests.jpa.sessionbean; -import java.util.Arrays; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.sessions.server.ServerSession; import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.entitylistener.EntityListenerTableCreator; import org.eclipse.persistence.testing.models.jpa.sessionbean.InjectionTest; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Properties; + public class EntityListenerInjectionTest extends JUnitTestCase { protected InjectionTest entityListenerTest; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/QueryParameterValidationTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/QueryParameterValidationTest.java index ac88d520252..264a888e14c 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/QueryParameterValidationTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/QueryParameterValidationTest.java @@ -17,10 +17,8 @@ package org.eclipse.persistence.testing.tests.jpa.validation; import jakarta.persistence.Query; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; public class QueryParameterValidationTest extends JUnitTestCase { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/ValidationTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/ValidationTest.java index 70dfdb77ee6..cc40b8d7844 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/ValidationTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.validation/src/test/java/org/eclipse/persistence/testing/tests/jpa/validation/ValidationTest.java @@ -14,21 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.jpa.validation; -import java.io.PrintWriter; -import java.util.HashMap; - import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.ValidationMode; import junit.framework.Test; import junit.framework.TestSuite; - -import java.util.Map; -import javax.sql.DataSource; -import java.sql.Connection; -import java.sql.SQLException; -import java.util.logging.Logger; - import org.eclipse.persistence.config.PersistenceUnitProperties; import org.eclipse.persistence.internal.jpa.EntityManagerImpl; import org.eclipse.persistence.jpa.JpaEntityManagerFactory; @@ -36,6 +26,13 @@ import org.eclipse.persistence.testing.framework.junit.JUnitTestCaseHelper; import org.eclipse.persistence.testing.models.jpa.validation.Item; +import javax.sql.DataSource; +import java.io.PrintWriter; +import java.sql.Connection; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; + public class ValidationTest extends JUnitTestCase { public ValidationTest() { } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/AdvancedMultiTenantTableCreator.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/AdvancedMultiTenantTableCreator.java index 5b8a7179742..c91423324ae 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/AdvancedMultiTenantTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/AdvancedMultiTenantTableCreator.java @@ -18,7 +18,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.advanced.multitenant; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedMultiTenantTableCreator extends TogglingFastTableCreator { public AdvancedMultiTenantTableCreator() { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/MafiaFamily.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/MafiaFamily.java index 4ab30642693..9e244128820 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/MafiaFamily.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/advanced/multitenant/MafiaFamily.java @@ -15,11 +15,10 @@ // - 337323: Multi-tenant with shared schema support (part 1) package org.eclipse.persistence.testing.models.jpa.xml.advanced.multitenant; +import java.io.Serializable; import java.util.Collection; import java.util.Vector; -import java.io.Serializable; - public class MafiaFamily implements Serializable { private int id; private String name; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenant123Test.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenant123Test.java index b7473abb187..0154069a8df 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenant123Test.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenant123Test.java @@ -22,7 +22,6 @@ package org.eclipse.persistence.testing.tests.jpa.xml.advanced; import jakarta.persistence.EntityManager; - import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.persistence.testing.models.jpa.xml.advanced.multitenant.Boss; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenantSharedEMFTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenantSharedEMFTest.java index c16722846f1..04c0829e442 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenantSharedEMFTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.advanced.multitenant/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/advanced/EntityMappingsMultitenantSharedEMFTest.java @@ -23,7 +23,6 @@ import jakarta.persistence.EntityManager; import jakarta.persistence.Query; - import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.persistence.config.EntityManagerProperties; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/Address.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/Address.java index def62f5fa61..3283fc214de 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/Address.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/Address.java @@ -14,10 +14,10 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1; -import java.io.Serializable; - import jakarta.persistence.Transient; +import java.io.Serializable; + /** *

* Purpose: Represents the mailing address on an Employee diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/AdvancedTableCreator_1.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/AdvancedTableCreator_1.java index b52b0f50292..a2db5831053 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/AdvancedTableCreator_1.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/AdvancedTableCreator_1.java @@ -29,7 +29,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedTableCreator_1 extends TogglingFastTableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/CacheAuditor.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/CacheAuditor.java index 1d44c292a36..57f3a736863 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/CacheAuditor.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_1/CacheAuditor.java @@ -15,8 +15,6 @@ // - 239825: XML configuration for Interceptors and Default redirectors package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1; -import java.util.Map; - import org.eclipse.persistence.descriptors.ClassDescriptor; import org.eclipse.persistence.indirection.ValueHolderInterface; import org.eclipse.persistence.internal.identitymaps.CacheKey; @@ -26,6 +24,8 @@ import org.eclipse.persistence.sessions.interceptors.CacheInterceptor; import org.eclipse.persistence.sessions.interceptors.CacheKeyInterceptor; +import java.util.Map; + public class CacheAuditor extends CacheInterceptor { protected boolean shouldThrow; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedReadTransformer.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedReadTransformer.java index e331c292dcc..d5e24610f59 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedReadTransformer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedReadTransformer.java @@ -14,13 +14,13 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2; -import java.sql.Time; - import org.eclipse.persistence.mappings.foundation.AbstractTransformationMapping; import org.eclipse.persistence.mappings.transformers.AttributeTransformer; import org.eclipse.persistence.sessions.DataRecord; import org.eclipse.persistence.sessions.Session; +import java.sql.Time; + public class AdvancedReadTransformer implements AttributeTransformer { String attributeName; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedTableCreator_2.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedTableCreator_2.java index f48fee65557..aeba8f54c95 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedTableCreator_2.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedTableCreator_2.java @@ -29,7 +29,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedTableCreator_2 extends TogglingFastTableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedWriteTransformer.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedWriteTransformer.java index 27f870781a4..59178cc0806 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedWriteTransformer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/AdvancedWriteTransformer.java @@ -14,12 +14,12 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2; -import java.sql.Time; - import org.eclipse.persistence.mappings.foundation.AbstractTransformationMapping; import org.eclipse.persistence.mappings.transformers.FieldTransformer; import org.eclipse.persistence.sessions.Session; +import java.sql.Time; + public class AdvancedWriteTransformer implements FieldTransformer { String attributeName; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/Employee.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/Employee.java index 6cab0cd170b..4868c07a4d5 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/Employee.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/Employee.java @@ -20,12 +20,7 @@ // - 286317: UniqueConstraint xml element is changing (plus couple other fixes, see bug) package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2; -import java.sql.Time; -import java.util.*; -import java.io.Serializable; - import jakarta.persistence.Transient; - import org.eclipse.persistence.annotations.Properties; import org.eclipse.persistence.annotations.Property; import org.eclipse.persistence.sessions.DataRecord; @@ -35,6 +30,15 @@ import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.Project; +import java.io.Serializable; +import java.sql.Time; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Vector; + /** * Employees have a one-to-many relationship with Employees through the * managedEmployees attribute. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/EmploymentPeriod.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/EmploymentPeriod.java index 011eb624e30..74aa17a1c73 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/EmploymentPeriod.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_2/EmploymentPeriod.java @@ -14,14 +14,13 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2; -import java.util.Date; -import java.io.*; - import jakarta.persistence.Entity; - import org.eclipse.persistence.annotations.Properties; import org.eclipse.persistence.annotations.Property; +import java.io.Serializable; +import java.util.Date; + /** *

Purpose: Defines the period an Employee worked for the organization *

Description: The period holds the start date and optionally the diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/AdvancedTableCreator_3.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/AdvancedTableCreator_3.java index c789d1b7a3a..91a6ef42a92 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/AdvancedTableCreator_3.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/AdvancedTableCreator_3.java @@ -29,7 +29,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3; import org.eclipse.persistence.testing.framework.TogglingFastTableCreator; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class AdvancedTableCreator_3 extends TogglingFastTableCreator { diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Dealer.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Dealer.java index 0ffa8c4d181..a310e0e3ae0 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Dealer.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Dealer.java @@ -14,11 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3; +import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1.Customer; + import java.util.ArrayList; import java.util.List; -import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1.Customer; - public class Dealer { private Integer id; private Integer version; diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumber.java index a2e27c938aa..b3ad0988af4 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumber.java @@ -16,10 +16,11 @@ // - 241651: JPA 2.0 Access Type support package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3; -import java.io.*; - import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2.Employee; +import java.io.Serializable; +import java.io.StringWriter; + /** *

Purpose: Describes an Employee's phone number. *

Description: Used in a 1:M relationship from an employee. diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumberPK.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumberPK.java index 2d0d43324c2..4e50f1cfc82 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumberPK.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/PhoneNumberPK.java @@ -16,6 +16,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3; +import java.util.Objects; + public class PhoneNumberPK { public Integer id; public String type; @@ -47,4 +49,9 @@ public boolean equals(Object anotherPhoneNumber) { } return (getId().equals(((PhoneNumberPK)anotherPhoneNumber).getId())); } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Project.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Project.java index 2d4f781766b..af1a7745b08 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Project.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/common/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/composite/advanced/member_3/Project.java @@ -16,11 +16,12 @@ // - 241651: JPA 2.0 Access Type support package org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3; -import java.util.*; -import java.io.Serializable; - import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2.Employee; +import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; + /** * Bean class: ProjectBean * Remote interface: Project diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/EmployeePopulator.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/EmployeePopulator.java index aefe2a1e320..23aa87f7c88 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/EmployeePopulator.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/EmployeePopulator.java @@ -21,8 +21,6 @@ // package org.eclipse.persistence.testing.tests.jpa.xml.composite.advanced; -import java.util.*; - import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.Session; import org.eclipse.persistence.sessions.UnitOfWork; @@ -37,6 +35,9 @@ import org.eclipse.persistence.tools.schemaframework.SchemaManager; import org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition; +import java.util.Calendar; +import java.util.Vector; + /** *

Purpose: To build and populate the database for example and testing purposes. * This population routine is fairly complex and makes use of the population manager to @@ -1191,11 +1192,11 @@ public EmploymentPeriod employmentPeriodExample9() { return employmentPeriod; } - protected Vector getAllObjects() { + protected Vector getAllObjects() { return populationManager.getAllObjects(); } - public Vector getAllObjectsForClass(Class domainClass) { + public Vector getAllObjectsForClass(Class domainClass) { return populationManager.getAllObjectsForClass(domainClass); } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/ModelExamples.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/ModelExamples.java index eb62401a1a7..98e4de6dedc 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/ModelExamples.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/ModelExamples.java @@ -18,8 +18,6 @@ package org.eclipse.persistence.testing.tests.jpa.xml.composite.advanced; -import java.sql.Date; - import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1.Address; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2.Employee; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_2.EmploymentPeriod; @@ -28,6 +26,8 @@ import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.Project; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.SmallProject; +import java.sql.Date; + public class ModelExamples { public static Employee employeeExample1(){ diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java index 44ab843adb3..86aef5d3d9a 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.composite.advanced/src/test/java/org/eclipse/persistence/testing/tests/jpa/xml/composite/advanced/XmlCompositeAdvancedJUnitTest.java @@ -21,18 +21,10 @@ // are commented out, the quick explanation why the test can't run is provided. package org.eclipse.persistence.testing.tests.jpa.xml.composite.advanced; -import java.lang.reflect.Array; -import java.sql.Date; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; -import java.util.Vector; - -import jakarta.persistence.EntityManagerFactory; -import jakarta.persistence.Query; import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; import jakarta.persistence.EntityNotFoundException; - +import jakarta.persistence.Query; import junit.framework.Test; import junit.framework.TestSuite; import org.eclipse.persistence.config.QueryHints; @@ -52,7 +44,9 @@ import org.eclipse.persistence.queries.DoesExistQuery; import org.eclipse.persistence.sessions.broker.SessionBroker; import org.eclipse.persistence.sessions.server.ServerSession; +import org.eclipse.persistence.testing.framework.JoinedAttributeTestHelper; import org.eclipse.persistence.testing.framework.TestCase; +import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1.Address; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1.AdvancedTableCreator_1; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_1.Bungalow; @@ -66,29 +60,15 @@ import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.PhoneNumber; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.Project; import org.eclipse.persistence.testing.models.jpa.xml.composite.advanced.member_3.SmallProject; -/*import org.eclipse.persistence.testing.models.jpa.xml.advanced.Confidant; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.Loner; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.Name; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ReadOnlyClass; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.Shovel; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ShovelDigger; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ShovelOwner; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ShovelProject; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ShovelSections; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.SmallProject; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ShovelSections.MaterialType; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.Violation; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ViolationCode; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.Violation.ViolationID; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.ViolationCode.ViolationCodeId; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.additionalcriteria.Bolt; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.additionalcriteria.Nut; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.additionalcriteria.School; -import org.eclipse.persistence.testing.models.jpa.xml.advanced.additionalcriteria.Student;*/ -import org.eclipse.persistence.testing.framework.JoinedAttributeTestHelper; -import org.eclipse.persistence.testing.framework.jpa.junit.JUnitTestCase; import org.eclipse.persistence.tools.schemaframework.TableCreator; +import java.lang.reflect.Array; +import java.sql.Date; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; +import java.util.Vector; + /** * JUnit test case(s) for the TopLink EntityMappingsXMLProcessor. */ @@ -347,7 +327,7 @@ public void testAdditionalCriteria() { EntityManager em = createEntityManager(); try { - List schools = em.createNamedQuery("findJPQLXMLSchools").getResultList(); + List schools = em.createNamedQuery("findJPQLXMLSchools").getResultList(); assertEquals("Incorrect number of schools were returned [" + schools.size() + "], expected [2]", 2, schools.size()); } catch (RuntimeException e) { if (isTransactionActive(em)){ @@ -375,7 +355,7 @@ public void testAdditionalCriteriaWithParameterFromEM1() { // Find the schools, because of our additional criteria on Student // and the property above, we should only return Ottawa students. - List students = em.createQuery("SELECT s from XMLStudent s").getResultList(); + List students = em.createQuery("SELECT s from XMLStudent s").getResultList(); assertEquals("Incorrect number of students were returned [" + students.size() + "], expected [8]", 8, students.size()); } catch (RuntimeException e) { if (isTransactionActive(em)){ @@ -404,7 +384,7 @@ public void testAdditionalCriteriaWithParameterFromEM2() { // and the property above, we should only return Toronto students. // However, they should not have any schools loaded. - List students = em.createQuery("SELECT s from XMLStudent s").getResultList(); + List students = em.createQuery("SELECT s from XMLStudent s").getResultList(); assertEquals("Incorrect number of students were returned [" + students.size() + "], expected [18]", 18, students.size()); } catch (RuntimeException e) { if (isTransactionActive(em)){ @@ -427,7 +407,7 @@ public void testAdditionalCriteriaWithParameterFromEMF() { try { // This should use the EMF NAME property of Montreal% - List students = em.createQuery("SELECT s from XMLStudent s").getResultList(); + List students = em.createQuery("SELECT s from XMLStudent s").getResultList(); assertEquals("Incorrect number of students were returned [" + students.size() + "], expected [5]", 5, students.size()); } catch (RuntimeException e) { if (isTransactionActive(em)){ @@ -452,7 +432,7 @@ public void testComplexAdditionalCriteria() { em.setProperty("NUT_SIZE", 8); em.setProperty("NUT_COLOR", "Grey"); - List bolts = em.createQuery("SELECT b from XMLBolt b").getResultList(); + List bolts = em.createQuery("SELECT b from XMLBolt b").getResultList(); assertEquals("Incorrect number of bolts were returned [" + bolts.size() + "], expected [2]", 2, bolts.size()); } catch (RuntimeException e) { if (isTransactionActive(em)){ @@ -834,7 +814,7 @@ public void testNamedNativeQueryOnAddress() { throw e; } Query query = em.createNamedQuery("findAllXMLAddresses"); - List addresses = query.getResultList(); + List addresses = query.getResultList(); assertNotNull("Error executing named native query 'findAllXMLAddresses'", addresses); } @@ -907,7 +887,7 @@ public void testRefreshRemovedEmployee() { String firstName = "testRefreshRemovedEmployee"; Employee emp; EntityManager em = createEntityManager(); - List result = em.createQuery("SELECT OBJECT(e) FROM XMLEmployee e WHERE e.firstName = '"+firstName+"'").getResultList(); + List result = em.createQuery("SELECT OBJECT(e) FROM XMLEmployee e WHERE e.firstName = '"+firstName+"'").getResultList(); if(!result.isEmpty()) { emp = (Employee)result.get(0); } else { @@ -966,7 +946,7 @@ public void testContainsRemovedEmployee() { String firstName = "testContainsRemovedEmployee"; Employee emp; EntityManager em = createEntityManager(); - List result = em.createQuery("SELECT OBJECT(e) FROM XMLEmployee e WHERE e.firstName = '"+firstName+"'").getResultList(); + List result = em.createQuery("SELECT OBJECT(e) FROM XMLEmployee e WHERE e.firstName = '"+firstName+"'").getResultList(); if(!result.isEmpty()) { emp = (Employee)result.get(0); } else { @@ -1009,7 +989,7 @@ public void testSubString() { String firstName = "testSubString"; Employee emp; EntityManager em = createEntityManager(); - List result = em.createQuery("SELECT OBJECT(e) FROM XMLEmployee e WHERE e.firstName = '"+firstName+"'").getResultList(); + List result = em.createQuery("SELECT OBJECT(e) FROM XMLEmployee e WHERE e.firstName = '"+firstName+"'").getResultList(); if(!result.isEmpty()) { emp = (Employee)result.get(0); } else { @@ -1031,7 +1011,7 @@ public void testSubString() { int firstIndex = 1; int lastIndex = firstName.length(); - List employees = em.createQuery("SELECT object(e) FROM XMLEmployee e where e.firstName = substring(:p1, :p2, :p3)"). + List employees = em.createQuery("SELECT object(e) FROM XMLEmployee e where e.firstName = substring(:p1, :p2, :p3)"). setParameter("p1", firstName). setParameter("p2", firstIndex). setParameter("p3", lastIndex). diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.incompletemappings.owning/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/incompletemappings/owning/PhoneNumberPK.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.incompletemappings.owning/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/incompletemappings/owning/PhoneNumberPK.java index 9a7e6d9cd9a..057039fbdd8 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.incompletemappings.owning/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/incompletemappings/owning/PhoneNumberPK.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.incompletemappings.owning/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/incompletemappings/owning/PhoneNumberPK.java @@ -16,6 +16,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.merge.incompletemappings.owning; +import java.util.Objects; + public class PhoneNumberPK { public Integer id; public String type; @@ -47,4 +49,9 @@ public boolean equals(Object anotherPhoneNumber) { } return (getId().equals(((PhoneNumberPK)anotherPhoneNumber).getId())); } + + @Override + public int hashCode() { + return Objects.hash(id, type); + } } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/Alpine.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/Alpine.java index e39d2f3ad6c..7a31db2fa5e 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/Alpine.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/Alpine.java @@ -24,6 +24,7 @@ import jakarta.persistence.Transient; import java.util.Date; +import java.util.Objects; import static jakarta.persistence.TemporalType.DATE; @@ -85,4 +86,9 @@ public boolean equals(Object anotherAlpine) { return (getId().equals(((Alpine)anotherAlpine).getId())); } + + @Override + public int hashCode() { + return Objects.hash(bestBeforeDate, classification, localTransientString); + } } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumber.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumber.java index 966863b5c53..e9b4f00331d 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumber.java @@ -23,6 +23,7 @@ import java.io.Serializable; import java.io.StringWriter; +import java.util.Objects; /** * This class is mapped in: @@ -60,6 +61,11 @@ public boolean equals(Object telephoneNumber) { return ((TelephoneNumber) telephoneNumber).buildPK().equals(buildPK()); } + @Override + public int hashCode() { + return Objects.hash(type, number, areaCode, beerConsumer); + } + public String getAreaCode() { return areaCode; } diff --git a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumberPK.java b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumberPK.java index dcd040c4b23..a9a2d986dcd 100644 --- a/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumberPK.java +++ b/jpa/eclipselink.jpa.testapps/jpa.test.xml.merge.inherited/src/main/java/org/eclipse/persistence/testing/models/jpa/xml/merge/inherited/TelephoneNumberPK.java @@ -15,6 +15,8 @@ package org.eclipse.persistence.testing.models.jpa.xml.merge.inherited; +import java.util.Objects; + public class TelephoneNumberPK { public String type; protected String number; @@ -60,4 +62,9 @@ public boolean equals(Object anotherTelephoneNumberPK) { ); } + + @Override + public int hashCode() { + return Objects.hash(type, number, areaCode); + } } diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Address.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Address.java index f273ee65ff8..ab656ca5d03 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Address.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Address.java @@ -14,8 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.nativeapitest; -import java.util.*; import java.io.Serializable; +import java.util.Collection; +import java.util.Vector; /** *

Purpose: Represents the mailing address on an Employee diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Department.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Department.java index 57359b2868f..fbe6ef58283 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Department.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Department.java @@ -15,7 +15,6 @@ package org.eclipse.persistence.testing.models.nativeapitest; import java.io.Serializable; - import java.util.Collection; import java.util.Vector; diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Employee.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Employee.java index 8390a55ea8c..cdbcc0e85ce 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Employee.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/Employee.java @@ -14,8 +14,11 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.nativeapitest; -import java.util.*; import java.io.Serializable; +import java.util.Collection; +import java.util.EnumSet; +import java.util.Set; +import java.util.Vector; public class Employee implements Serializable, Cloneable { diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/EmployeeServiceBean.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/EmployeeServiceBean.java index f87792726b1..f1a6f7def52 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/EmployeeServiceBean.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/EmployeeServiceBean.java @@ -14,19 +14,18 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.nativeapitest; -import java.util.*; - import jakarta.ejb.Remote; import jakarta.ejb.Stateless; - -// EclipseLink imports -import org.eclipse.persistence.sessions.server.*; -import org.eclipse.persistence.sessions.factories.SessionManager; -import org.eclipse.persistence.sessions.*; import org.eclipse.persistence.expressions.Expression; import org.eclipse.persistence.expressions.ExpressionBuilder; import org.eclipse.persistence.queries.ReadAllQuery; import org.eclipse.persistence.queries.ReadObjectQuery; +import org.eclipse.persistence.sessions.UnitOfWork; +import org.eclipse.persistence.sessions.factories.SessionManager; +import org.eclipse.persistence.sessions.server.ClientSession; +import org.eclipse.persistence.sessions.server.Server; + +import java.util.List; /** * EmployeeService session bean. diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/NativeAPITestTableCreator.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/NativeAPITestTableCreator.java index b00641379bd..3e4e7e6c542 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/NativeAPITestTableCreator.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/NativeAPITestTableCreator.java @@ -14,7 +14,9 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.nativeapitest; -import org.eclipse.persistence.tools.schemaframework.*; +import org.eclipse.persistence.tools.schemaframework.FieldDefinition; +import org.eclipse.persistence.tools.schemaframework.TableCreator; +import org.eclipse.persistence.tools.schemaframework.TableDefinition; public class NativeAPITestTableCreator extends TableCreator { public NativeAPITestTableCreator() { diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/PhoneNumber.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/PhoneNumber.java index d07c5ca3a1f..471bc165bdf 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/PhoneNumber.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/main/java/org/eclipse/persistence/testing/models/nativeapitest/PhoneNumber.java @@ -14,7 +14,8 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.models.nativeapitest; -import java.io.*; +import java.io.Serializable; +import java.io.StringWriter; import java.util.Collection; import java.util.List; import java.util.Vector; diff --git a/jpa/eclipselink.jpa.testapps/nativeapi/src/test/java/org/eclipse/persistence/testing/tests/nativeapitest/NativeAPITests.java b/jpa/eclipselink.jpa.testapps/nativeapi/src/test/java/org/eclipse/persistence/testing/tests/nativeapitest/NativeAPITests.java index 7d21f134367..b2612a1fd6d 100644 --- a/jpa/eclipselink.jpa.testapps/nativeapi/src/test/java/org/eclipse/persistence/testing/tests/nativeapitest/NativeAPITests.java +++ b/jpa/eclipselink.jpa.testapps/nativeapi/src/test/java/org/eclipse/persistence/testing/tests/nativeapitest/NativeAPITests.java @@ -14,18 +14,8 @@ // Oracle - initial API and implementation from Oracle TopLink package org.eclipse.persistence.testing.tests.nativeapitest; -import java.util.Arrays; -import java.util.Iterator; -import java.util.List; -import java.util.Properties; - -import javax.naming.Context; -import javax.naming.InitialContext; -import javax.naming.NamingException; - import junit.framework.Test; import junit.framework.TestSuite; - import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.sessions.factories.SessionManager; import org.eclipse.persistence.sessions.server.ServerSession; @@ -36,6 +26,14 @@ import org.eclipse.persistence.testing.models.nativeapitest.EmployeeService; import org.eclipse.persistence.testing.models.nativeapitest.NativeAPITestTableCreator; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + /** * EJB 3 NativeAPITests tests. Testing using EclipseLink Native ORM API in a JEE * EJB 3 SessionBean environment. These tests can only be run with a server. From c5e01f9416f34f85b7e785755195ccd4bc3e0111 Mon Sep 17 00:00:00 2001 From: Lukas Jungmann Date: Wed, 3 Aug 2022 23:35:06 +0200 Subject: [PATCH 2/3] remove/hide not needed parts of the build in testapps Signed-off-by: Lukas Jungmann --- bundles/eclipselink/pom.xml | 19 +++++-- jpa/eclipselink.jpa.testapps/pom.xml | 80 ++++++++++++++++++++++++++++ pom.xml | 15 ++++-- 3 files changed, 104 insertions(+), 10 deletions(-) diff --git a/bundles/eclipselink/pom.xml b/bundles/eclipselink/pom.xml index 4e7bdedff98..2bf2f225246 100644 --- a/bundles/eclipselink/pom.xml +++ b/bundles/eclipselink/pom.xml @@ -357,11 +357,7 @@ bundle-manifest - - - ${project.build.directory}/tmp-m - + none @@ -550,6 +546,19 @@ + + + default-jar + none + + + jar + prepare-package + + jar + + + org.apache.maven.plugins diff --git a/jpa/eclipselink.jpa.testapps/pom.xml b/jpa/eclipselink.jpa.testapps/pom.xml index dc311b6c198..c71cb630a7b 100644 --- a/jpa/eclipselink.jpa.testapps/pom.xml +++ b/jpa/eclipselink.jpa.testapps/pom.xml @@ -352,6 +352,13 @@ org.apache.maven.plugins maven-jar-plugin + + jar + + jar + + none + package-model @@ -430,6 +437,20 @@ + + org.apache.maven.plugins + maven-jar-plugin + + + default-jar + none + + + jar + package + + + org.eclipse.persistence @@ -449,6 +470,65 @@ + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + release.version-property + none + + + add-integration-test-sources + none + + + add-integration-test-resources + none + + + + + org.apache.felix + maven-bundle-plugin + + + bundle-manifest + none + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack-spotbugs-filter + none + + + + + org.apache.maven.plugins + maven-surefire-report-plugin + + + generate-surefire-html-report + none + + + generate-failsafe-html-report + none + + + generate-test-summary-html-report + none + + + diff --git a/pom.xml b/pom.xml index 62316081465..fa77e7f1735 100644 --- a/pom.xml +++ b/pom.xml @@ -1567,11 +1567,16 @@ org.apache.maven.plugins maven-jar-plugin - - - ${project.build.outputDirectory}/META-INF/MANIFEST.MF - - + + + default-jar + + + ${project.build.outputDirectory}/META-INF/MANIFEST.MF + + + + From 4e1959ddaaa1390267bf3d04de6cfcf9e93ccbf6 Mon Sep 17 00:00:00 2001 From: Lukas Jungmann Date: Thu, 4 Aug 2022 00:42:27 +0200 Subject: [PATCH 3/3] make the jpa dependency on json optional Signed-off-by: Lukas Jungmann --- foundation/org.eclipse.persistence.json/pom.xml | 2 -- jpa/org.eclipse.persistence.jpa/pom.xml | 8 ++++++++ .../src/main/java/module-info.java | 2 +- .../jpa/metadata/accessors/mappings/MappingAccessor.java | 4 +--- .../jpa/metadata/converters/JsonValueMetadata.java | 4 +--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/foundation/org.eclipse.persistence.json/pom.xml b/foundation/org.eclipse.persistence.json/pom.xml index c8c4a640d81..4587350d308 100644 --- a/foundation/org.eclipse.persistence.json/pom.xml +++ b/foundation/org.eclipse.persistence.json/pom.xml @@ -45,8 +45,6 @@ jakarta.json jakarta.json-api - provided - true diff --git a/jpa/org.eclipse.persistence.jpa/pom.xml b/jpa/org.eclipse.persistence.jpa/pom.xml index 2825d7c6424..269ed019883 100644 --- a/jpa/org.eclipse.persistence.jpa/pom.xml +++ b/jpa/org.eclipse.persistence.jpa/pom.xml @@ -40,6 +40,12 @@ org.eclipse.persistence org.eclipse.persistence.core + + org.eclipse.persistence + org.eclipse.persistence.json + runtime + true + org.eclipse.persistence org.eclipse.persistence.jpa.jpql @@ -52,6 +58,7 @@ jakarta.json jakarta.json-api + true jakarta.enterprise @@ -155,6 +162,7 @@ org.eclipse.persistence.internal.libraries.asm*;version="${version;==;${@}}", + org.eclipse.persistence.json;resolution:=optional, * diff --git a/jpa/org.eclipse.persistence.jpa/src/main/java/module-info.java b/jpa/org.eclipse.persistence.jpa/src/main/java/module-info.java index 712543eee23..d5bc98b5551 100644 --- a/jpa/org.eclipse.persistence.jpa/src/main/java/module-info.java +++ b/jpa/org.eclipse.persistence.jpa/src/main/java/module-info.java @@ -20,7 +20,7 @@ requires org.eclipse.persistence.jpa.jpql; requires transitive jakarta.persistence; - requires transitive jakarta.json; + requires static jakarta.json; requires static jakarta.transaction; requires static jakarta.validation; diff --git a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/MappingAccessor.java b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/MappingAccessor.java index 61da8371fdf..73c06e8ea98 100644 --- a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/MappingAccessor.java +++ b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/accessors/mappings/MappingAccessor.java @@ -108,8 +108,6 @@ import java.util.Map; import java.util.Set; -import jakarta.json.JsonValue; - import org.eclipse.persistence.annotations.Convert; import org.eclipse.persistence.annotations.JoinFetchType; import org.eclipse.persistence.annotations.Properties; @@ -1447,7 +1445,7 @@ public boolean isTransient() { * or {@code false} otherwise */ protected boolean isValidJsonType(MetadataClass cls) { - return cls.extendsInterface(JsonValue.class); + return cls.extendsInterface("jakarta.json.JsonValue"); } /** diff --git a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/converters/JsonValueMetadata.java b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/converters/JsonValueMetadata.java index 3dd660eec14..678ce545045 100644 --- a/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/converters/JsonValueMetadata.java +++ b/jpa/org.eclipse.persistence.jpa/src/main/java/org/eclipse/persistence/internal/jpa/metadata/converters/JsonValueMetadata.java @@ -14,8 +14,6 @@ // 13/01/2022-4.0.0 Tomas Kraus - 1391: JSON support in JPA package org.eclipse.persistence.internal.jpa.metadata.converters; -import jakarta.json.JsonValue; - import org.eclipse.persistence.exceptions.ValidationException; import org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor; import org.eclipse.persistence.internal.jpa.metadata.accessors.objects.MetadataClass; @@ -49,7 +47,7 @@ public int hashCode() { @Override public void process(DatabaseMapping mapping, MappingAccessor accessor, MetadataClass referenceClass, boolean isForMapKey) { - if (accessor.getReferenceClass().extendsInterface(JsonValue.class) + if (accessor.getReferenceClass().extendsInterface("jakarta.json.JsonValue") || accessor.getReferenceClass().isArray() || accessor.getReferenceClass().isInterface()) { if (ConverterManager.getInstance().hasConverter(TYPE_NAME)) {