In C:\Project\EssentialsCVS\glassfish\entity-persistence-tests\src\java\oracle\toplink\essentials\testing\tests\cmp3\advanced: "C:\Program Files\TortoiseCVS\cvs.exe" -q diff -u -r 1.5 UpdateAllQueryAdvancedJunitTest.java CVSROOT=:pserver:kylechen@localhost:/cvs Index: UpdateAllQueryAdvancedJunitTest.java =================================================================== RCS file: /cvs/glassfish/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/UpdateAllQueryAdvancedJunitTest.java,v retrieving revision 1.5 diff -u -r1.5 UpdateAllQueryAdvancedJunitTest.java --- UpdateAllQueryAdvancedJunitTest.java 4 Jan 2007 14:30:35 -0000 1.5 +++ UpdateAllQueryAdvancedJunitTest.java 13 Jul 2007 18:49:11 -0000 @@ -33,6 +33,7 @@ import oracle.toplink.essentials.expressions.Expression; import oracle.toplink.essentials.expressions.ExpressionBuilder; import oracle.toplink.essentials.expressions.ExpressionMath; +import oracle.toplink.essentials.internal.helper.DatabaseField; import oracle.toplink.essentials.queryframework.DeleteAllQuery; import oracle.toplink.essentials.queryframework.UpdateAllQuery; import oracle.toplink.essentials.sessions.DatabaseSession; @@ -40,6 +41,7 @@ import oracle.toplink.essentials.testing.framework.junit.JUnitTestCase; import oracle.toplink.essentials.testing.models.cmp3.advanced.*; import oracle.toplink.essentials.testing.framework.UpdateAllQueryTestHelper; +import oracle.toplink.essentials.threetier.ServerSession; public class UpdateAllQueryAdvancedJunitTest extends JUnitTestCase { @@ -125,6 +127,55 @@ updateAllQueryInternal(updateQuery); } + //This test created for bug 3307, the prepared temporary table query should pickup the + //defined column definition, for databaseplatform that not support temporary table will bypass the verification. + public static void testOverridenColumnDefinition() { + Exception e = null; + ServerSession session = getServerSession(); + ClassDescriptor employeeClassDescriptor = session.getProject().getDescriptor(Employee.class); + + //set column definition for field 'F_NAME' + Vector fields= employeeClassDescriptor.getFields(); + DatabaseField originalEmployeeFirstNameDatabaseField = null; + for(int i=0;i0); + } + } + + + public static void testFirstNamePrefixBLAForSalary() { ExpressionBuilder builder = new ExpressionBuilder(); Expression selectionExpression = builder.get("salary").lessThan(20000); In C:\Project\EssentialsCVS\glassfish\entity-persistence\src\java\oracle\toplink\essentials\internal\databaseaccess: "C:\Program Files\TortoiseCVS\cvs.exe" -q diff -u -r 1.21 DatabasePlatform.java CVSROOT=:pserver:kylechen@localhost:/cvs Index: DatabasePlatform.java =================================================================== RCS file: /cvs/glassfish/entity-persistence/src/java/oracle/toplink/essentials/internal/databaseaccess/DatabasePlatform.java,v retrieving revision 1.21 diff -u -r1.21 DatabasePlatform.java --- DatabasePlatform.java 22 May 2007 23:54:20 -0000 1.21 +++ DatabasePlatform.java 12 Jul 2007 19:39:57 -0000 @@ -1697,7 +1697,13 @@ Iterator itFields = fields.iterator(); while(itFields.hasNext()) { DatabaseField field = (DatabaseField)itFields.next(); - FieldDefinition fieldDef = new FieldDefinition(field.getName(), ConversionManager.getObjectClass(field.getType())); + FieldDefinition fieldDef; + //bug3307, should use columnDefinition if it was defined. + if(field.getColumnDefinition().length() == 0){ + fieldDef = new FieldDefinition(field.getName(), ConversionManager.getObjectClass(field.getType())); + }else{ + fieldDef = new FieldDefinition(field.getName(), field.getColumnDefinition()); + } if(pkFields.contains(field) && shouldTempTableSpecifyPrimaryKeys()) { fieldDef.setIsPrimaryKey(true); } Success, CVS operation completed