Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 174439 Details for
Bug 317197
WDF Tests: org.eclipse.persistence.testing.tests.wdf.jpa1.foreignkeys.TestForeignKeys.testInheritance failed on both javaSE and javaEE
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
additional patch fixing issue on Oracle
bug317197_b.patch (text/plain), 10.18 KB, created by
Adrian Goerler
on 2010-07-15 15:31:51 EDT
(
hide
)
Description:
additional patch fixing issue on Oracle
Filename:
MIME Type:
Creator:
Adrian Goerler
Created:
2010-07-15 15:31:51 EDT
Size:
10.18 KB
patch
obsolete
>Index: jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/customizer/AdjustByteArrayCustomizer.java >=================================================================== >--- jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/customizer/AdjustByteArrayCustomizer.java (revision 0) >+++ jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/customizer/AdjustByteArrayCustomizer.java (revision 0) >@@ -0,0 +1,65 @@ >+package org.eclipse.persistence.testing.framework.wdf.customizer; >+ >+import org.eclipse.persistence.config.DescriptorCustomizer; >+import org.eclipse.persistence.descriptors.ClassDescriptor; >+import org.eclipse.persistence.internal.helper.DatabaseField; >+import org.eclipse.persistence.mappings.DatabaseMapping; >+import org.eclipse.persistence.mappings.ManyToManyMapping; >+import org.eclipse.persistence.mappings.OneToOneMapping; >+import org.eclipse.persistence.platform.database.DatabasePlatform; >+import org.eclipse.persistence.platform.database.MySQLPlatform; >+import org.eclipse.persistence.platform.database.OraclePlatform; >+ >+public class AdjustByteArrayCustomizer implements DescriptorCustomizer { >+ >+ private static final String BINARY = "BINARY"; >+ private static Class<? extends DatabasePlatform> databasePlatformClass; >+ >+ >+ public static void setDatabasePlatformClass( >+ Class<? extends DatabasePlatform> databasePlatformClass) { >+ AdjustByteArrayCustomizer.databasePlatformClass = databasePlatformClass; >+ } >+ >+ @Override >+ public void customize(ClassDescriptor descriptor) throws Exception { >+ >+ Iterable<DatabaseMapping> mappings = descriptor.getMappings(); >+ for (DatabaseMapping mapping : mappings) { >+ if (mapping.isDirectToFieldMapping()) { >+ adjustDatabaseField(mapping.getField()); >+ } if (mapping.isOneToOneMapping()) { >+ OneToOneMapping oneToOneMapping = (OneToOneMapping) mapping; >+ for(DatabaseField field : oneToOneMapping.getForeignKeyFields()) { >+ adjustDatabaseField(field); >+ } >+ } else if (mapping.isManyToManyMapping()) { >+ ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mapping; >+ for(DatabaseField field : manyToManyMapping.getSourceRelationKeyFields()) { >+ adjustDatabaseField(field); >+ } >+ for(DatabaseField field : manyToManyMapping.getTargetRelationKeyFields()) { >+ adjustDatabaseField(field); >+ } >+ } >+ } >+ } >+ >+ private void adjustDatabaseField(DatabaseField field) { >+ String columnDefintion = field.getColumnDefinition(); >+ if (columnDefintion != null && columnDefintion.startsWith(BINARY)) { >+ final String newDefinition; >+ if (OraclePlatform.class.isAssignableFrom(databasePlatformClass)) { >+ newDefinition = columnDefintion.replace(BINARY, "RAW"); >+ } else if (MySQLPlatform.class.isAssignableFrom(databasePlatformClass)){ >+ newDefinition = columnDefintion.replace(BINARY, "binary"); >+ } else if (databasePlatformClass.getName().endsWith("MaxDBPlatform")) { >+ newDefinition = columnDefintion.replace(BINARY, "CHAR") + " BYTE"; >+ } else { >+ newDefinition = columnDefintion; >+ } >+ field.setColumnDefinition(newDefinition); >+ } >+ } >+ >+} >Index: jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/SkipBugzillaTestRunner.java >=================================================================== >--- jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/SkipBugzillaTestRunner.java (revision 7783) >+++ jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/framework/wdf/SkipBugzillaTestRunner.java (working copy) >@@ -26,6 +26,7 @@ > > import org.eclipse.persistence.config.PersistenceUnitProperties; > import org.eclipse.persistence.platform.database.DatabasePlatform; >+import org.eclipse.persistence.testing.framework.wdf.customizer.AdjustByteArrayCustomizer; > import org.eclipse.persistence.testing.framework.wdf.server.Notification; > import org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunner; > import org.junit.Assert; >@@ -112,11 +113,12 @@ > String databasePlatformClassName = testProperties.get(PersistenceUnitProperties.TARGET_DATABASE); > > >- if (databasePlatformClassName != null) { >- databasePlatformClass = (Class<? extends DatabasePlatform>) Class.forName(databasePlatformClassName); >- } else { >- databasePlatformClass = null; // FIXME >- } >+ if (databasePlatformClassName != null) { >+ databasePlatformClass = (Class<? extends DatabasePlatform>) Class.forName(databasePlatformClassName); >+ AdjustByteArrayCustomizer.setDatabasePlatformClass(databasePlatformClass); >+ } else { >+ databasePlatformClass = null; // FIXME >+ } > > String testBugzillaRun = (String) testProperties.get(TEST_BUGZILLA_RUN); > if ("all".equals(testBugzillaRun)) { >Index: jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Employee.java >=================================================================== >--- jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Employee.java (revision 7814) >+++ jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Employee.java (working copy) >@@ -48,6 +48,9 @@ > import javax.persistence.Transient; > import javax.persistence.UniqueConstraint; > >+import org.eclipse.persistence.annotations.Customizer; >+import org.eclipse.persistence.testing.framework.wdf.customizer.AdjustByteArrayCustomizer; >+ > @Cacheable(true) > @Entity > @Table(name = "TMP_EMP", uniqueConstraints = @UniqueConstraint(columnNames = { "ID", "DEPARTMENT" })) >@@ -55,6 +58,7 @@ > @NamedNativeQueries( { > @NamedNativeQuery(name = "Employee.schlonz", query = "select \"TMP_EMP\".* from \"TMP_EMP\"", resultClass = Employee.class), > @NamedNativeQuery(name = "Employee.schlonzHint", query = "select \"TMP_EMP\".* from \"TMP_EMP\"", resultClass = Employee.class) }) >+@Customizer(AdjustByteArrayCustomizer.class) > public class Employee implements Serializable { > > private static final long serialVersionUID = 1L; >@@ -152,7 +156,7 @@ > // <join-column name="PROFILE_GUID"/> > // </attribute> > @OneToOne >- @JoinColumn(name = "PROFILE_GUID", columnDefinition="binary(16) DEFAULT NULL") >+ @JoinColumn(name = "PROFILE_GUID", columnDefinition=TravelProfile.BINARY_16_COLUMN) > protected TravelProfile travelProfile; > > // <attribute name="hobbies"> >Index: jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Item_Byte.java >=================================================================== >--- jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Item_Byte.java (revision 7816) >+++ jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Item_Byte.java (working copy) >@@ -26,11 +26,15 @@ > import javax.persistence.OneToMany; > import javax.persistence.Table; > >+import org.eclipse.persistence.annotations.Customizer; >+import org.eclipse.persistence.testing.framework.wdf.customizer.AdjustByteArrayCustomizer; >+ > @Entity > @Table(name = "BYTE_ITEM") >+@Customizer(AdjustByteArrayCustomizer.class) > public class Item_Byte implements Serializable { > @Id >- @Column(name = "ITEM_ID", columnDefinition="binary(16)") >+ @Column(name = "ITEM_ID", columnDefinition=TravelProfile.BINARY_16_COLUMN) > private byte[] itemId; > private String namespace; > private String text; >Index: jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/TravelProfile.java >=================================================================== >--- jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/TravelProfile.java (revision 7814) >+++ jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/TravelProfile.java (working copy) >@@ -22,9 +22,15 @@ > import javax.persistence.ManyToMany; > import javax.persistence.Table; > >+import org.eclipse.persistence.annotations.Customizer; >+import org.eclipse.persistence.testing.framework.wdf.customizer.AdjustByteArrayCustomizer; >+ > @Entity > @Table(name = "TMP_PROFILE") >+@Customizer(AdjustByteArrayCustomizer.class) > public class TravelProfile { >+ >+ static final String BINARY_16_COLUMN = "BINARY(16)"; > > /** > * @param guid >@@ -86,7 +92,7 @@ > * @return Returns the guid. > */ > @Id >- @Column(length = 16, columnDefinition="binary(16) DEFAULT NULL") >+ @Column(length = 16, columnDefinition=BINARY_16_COLUMN) > public byte[] getGuid() { > return guid; > } >Index: jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Vehicle.java >=================================================================== >--- jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Vehicle.java (revision 7814) >+++ jpa/eclipselink.jpa.wdf.test/src/org/eclipse/persistence/testing/models/wdf/jpa1/employee/Vehicle.java (working copy) >@@ -34,12 +34,16 @@ > import javax.persistence.TableGenerator; > import javax.persistence.Version; > >+import org.eclipse.persistence.annotations.Customizer; >+import org.eclipse.persistence.testing.framework.wdf.customizer.AdjustByteArrayCustomizer; >+ > @Cacheable(value = true) > @Entity > @Table(name = "TMP_VEHICLE") > @EntityListeners( { VehicleListener.class }) > @DiscriminatorColumn(name = "DTYPE", discriminatorType = DiscriminatorType.INTEGER) > @DiscriminatorValue("-1") >+@Customizer(AdjustByteArrayCustomizer.class) > public class Vehicle implements Serializable { > > private static final long serialVersionUID = 1L; >@@ -59,7 +63,7 @@ > int version; > > @ManyToMany >- @JoinTable(name = "TMP_VEHICLE_PROFILE", joinColumns = { @JoinColumn(name = "VEHICLE_ID") }, inverseJoinColumns = { @JoinColumn(name = "PROFILE_ID", columnDefinition="binary(16) DEFAULT NULL") }) >+ @JoinTable(name = "TMP_VEHICLE_PROFILE", joinColumns = { @JoinColumn(name = "VEHICLE_ID") }, inverseJoinColumns = { @JoinColumn(name = "PROFILE_ID", columnDefinition=TravelProfile.BINARY_16_COLUMN) }) > private Set<TravelProfile> profiles; > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 317197
:
174173
|
174439
|
174513
|
176709