================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/ExecuteUpdateTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:17:22 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/ExecuteUpdateTest.java Thu Dec 7 09:18:34 2006 *************** *** 8,13 **** --- 8,14 ---- import oracle.toplink.essentials.testing.models.cmp3.fieldaccess.relationships.*; import oracle.toplink.essentials.testing.tests.cmp3.EntityContainerTestBase; import oracle.toplink.essentials.exceptions.QueryException; + import javax.persistence.RollbackException; /* * Tests for the executeUpdate method on the EJBQueryImpl class *************** *** 29,34 **** --- 30,36 ---- protected String nameChange3 = "New Name3"; protected String returnedName1,returnedName2,returnedName3 = null; protected Exception expectedException =null; + protected RollbackException expectedException2 = null; public ExecuteUpdateTest() { } *************** *** 111,123 **** expectedException=expected; } commitTransaction(); ! } catch (Exception ex) { - try{ - commitTransaction(); - }catch(Exception comitEx){} throw new TestErrorException("Exception thrown while executing updates" + ex, ex); } } --- 113,129 ---- expectedException=expected; } + try { commitTransaction(); ! expectedException2 = null; ! }catch(RollbackException ex){ ! expectedException2 = ex; ! } ! } catch (Exception ex) { throw new TestErrorException("Exception thrown while executing updates" + ex, ex); + } finally { + rollbackTransaction(); } } *************** *** 131,137 **** if ( (returnedName3==null || !returnedName3.equals(nameChange3))){ throw new TestErrorException("Customer name did not get updated correctly should be:"+nameChange3 +" is :"+returnedName3); } ! if ( expectedException==null) throw new TestErrorException("excuteUpdate did not result in an exception on findAllCustomersFieldAccess named ReadAllQuery"); } } --- 137,147 ---- if ( (returnedName3==null || !returnedName3.equals(nameChange3))){ throw new TestErrorException("Customer name did not get updated correctly should be:"+nameChange3 +" is :"+returnedName3); } ! if ( expectedException==null) { throw new TestErrorException("excuteUpdate did not result in an exception on findAllCustomersFieldAccess named ReadAllQuery"); + } + if ( expectedException2==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } } } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetResultListTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:18:24 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetResultListTest.java Thu Dec 7 09:18:34 2006 *************** *** 11,16 **** --- 11,17 ---- import oracle.toplink.essentials.testing.framework.*; import oracle.toplink.essentials.testing.models.cmp3.fieldaccess.relationships.*; import java.util.List; + import javax.persistence.RollbackException; /* * Tests using the 'getSingleResult' api on a Query object obtained from the EntityManager * Also tests bugs 4300879 - check non List container policy error *************** *** 26,31 **** --- 27,33 ---- public Integer[] cusIDs = new Integer[3]; + protected RollbackException expectedException3 = null; public GetResultListTest() { } *************** *** 68,79 **** expectedException2 = exceptionExpected2; } - commitTransaction(); - }catch (Exception unexpectedException){ try{ commitTransaction(); ! }catch(Exception comitEx){} throw new TestErrorException("Problem in GetResultListTest: "+unexpectedException); } } --- 70,86 ---- expectedException2 = exceptionExpected2; } try{ commitTransaction(); ! expectedException3 = null; ! }catch(RollbackException ex){ ! expectedException3 = ex; ! } ! ! }catch (Exception unexpectedException){ throw new TestErrorException("Problem in GetResultListTest: "+unexpectedException); + }finally{ + rollbackTransaction(); } } *************** *** 90,95 **** --- 97,105 ---- if ( expectedException2==null || (expectedException2.getErrorCode()!= QueryException.INCORRECT_QUERY_FOUND)){ throw new TestErrorException("getResultList on ReadObjectQuery did not throw expected INCORRECT_QUERY_FOUNDQueryException"); } + if ( expectedException3==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } } } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetSingleResultTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:19:31 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetSingleResultTest.java Thu Dec 7 09:18:34 2006 *************** *** 4,9 **** --- 4,10 ---- import javax.persistence.NoResultException; import javax.persistence.NonUniqueResultException; import javax.persistence.Query; + import javax.persistence.RollbackException; import oracle.toplink.essentials.exceptions.QueryException; import oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl; import oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl; *************** *** 30,35 **** --- 31,37 ---- protected NonUniqueResultException expectedException1 = null; protected NoResultException expectedException2 = null; protected QueryException expectedException3 = null; + protected RollbackException expectedException4 = null; protected String searchString = "notAnItemName"; *************** *** 118,129 **** query4.setDatabaseQuery(readObjectQuery); returnedCustomer2 = (Customer)query4.getSingleResult(); - commitTransaction(); - }catch (Exception unexpectedException){ try{ commitTransaction(); ! }catch(Exception comitEx){} throw new TestErrorException("Problem in GetSingleResultTest: "+unexpectedException); } } --- 120,136 ---- query4.setDatabaseQuery(readObjectQuery); returnedCustomer2 = (Customer)query4.getSingleResult(); try{ commitTransaction(); ! expectedException4 = null; ! }catch(RollbackException ex){ ! expectedException4 = ex; ! } ! ! }catch (Exception unexpectedException){ throw new TestErrorException("Problem in GetSingleResultTest: "+unexpectedException); + }finally{ + rollbackTransaction(); } } *************** *** 137,142 **** --- 144,152 ---- if ( ( expectedException3==null ) || ( expectedException3.getErrorCode()!= QueryException.INVALID_CONTAINER_CLASS ) ){ throw new TestErrorException("getSingelResult using ReadAllQuery with MapContainerPolicy did not throw expected INVALID_CONTAINER_CLASS QueryException"); } + if ( expectedException4==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } if ( returnedCustomer1==null || (!returnedCustomer1.getCustomerId().equals(cusIDs[0])) ){ throw new TestErrorException("Incorrect Single Customer returned, found: "+returnedCustomer1); } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/fieldaccess/relationships/RelationshipsTableManager.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:41:21 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/fieldaccess/relationships/RelationshipsTableManager.java Thu Dec 7 09:18:34 2006 *************** *** 346,352 **** // SECTION: FIELD FieldDefinition field = new FieldDefinition(); ! field.setName("CUSTOMER_CUST_ID"); field.setTypeName("NUMERIC"); field.setSize(15); field.setShouldAllowNull(false); --- 346,352 ---- // SECTION: FIELD FieldDefinition field = new FieldDefinition(); ! field.setName("FieldAccessCustomer_CUST_ID"); field.setTypeName("NUMERIC"); field.setSize(15); field.setShouldAllowNull(false); ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/AdvancedTableCreator.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.14 Thu Dec 7 09:14:15 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/AdvancedTableCreator.java Thu Dec 7 09:18:34 2006 *************** *** 40,45 **** --- 40,46 ---- addTableDefinition(buildPLATINUMBUYERTable()); addTableDefinition(buildBUYERTable()); addTableDefinition(buildDEPTTable()); + addTableDefinition(buildDEPT_EMPTable()); } public static TableDefinition buildADDRESSTable() { *************** *** 675,678 **** --- 676,711 ---- return table; } + + public static TableDefinition buildDEPT_EMPTable() { + TableDefinition table = new TableDefinition(); + table.setName("CMP3_DEPT_CMP3_EMPLOYEE"); + + // SECTION: FIELD + oracle.toplink.essentials.tools.schemaframework.FieldDefinition fieldID = new oracle.toplink.essentials.tools.schemaframework.FieldDefinition(); + fieldID.setName("ADV_DEPT_ID"); + fieldID.setTypeName("NUMERIC"); + fieldID.setSize(15); + fieldID.setShouldAllowNull(false); + fieldID.setIsPrimaryKey(true); + fieldID.setUnique(false); + fieldID.setIsIdentity(false); + fieldID.setForeignKeyFieldName("CMP3_DEPT.ID"); + table.addField(fieldID); + + // SECTION: FIELD + oracle.toplink.essentials.tools.schemaframework.FieldDefinition fieldEMP = new oracle.toplink.essentials.tools.schemaframework.FieldDefinition(); + fieldEMP.setName("MANAGERS_EMP_ID"); + fieldEMP.setTypeName("NUMERIC"); + fieldEMP.setSize(15); + fieldEMP.setShouldAllowNull(false); + fieldEMP.setIsPrimaryKey(true); + fieldEMP.setUnique(false); + fieldEMP.setIsIdentity(false); + fieldEMP.setForeignKeyFieldName("CMP3_EMPLOYEE.EMP_ID"); + table.addField(fieldEMP); + + return table; + } + } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/Department.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:53:18 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/Department.java Thu Dec 7 09:18:34 2006 *************** *** 47,52 **** --- 47,53 ---- private Integer id; private String name; private Collection employees; + private Collection managers; public Department() { this(""); *************** *** 54,59 **** --- 55,61 ---- public Department(String name) { this.name = name; + managers = new Vector(); } @Id *************** *** 89,92 **** --- 91,110 ---- public void setEmployees(Collection employees) { this.employees = employees; } + + //To test default 1-M mapping + @OneToMany(fetch=EAGER, cascade=PERSIST) + public Collection getManagers() { + return managers; + } + + public void setManagers(Collection managers) { + this.managers = managers; + } + + public void addManager(Employee employee) { + if (employee != null && managers != null && !managers.contains(employee)) { + this.managers.add(employee); + } + } } \ No newline at end of file ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.61 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.61 Wed Dec 6 15:59:48 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java Thu Dec 7 09:18:34 2006 *************** *** 3668,3674 **** fail(errorMsg); } } ! public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); --- 3668,3695 ---- fail(errorMsg); } } ! ! //gf 1217 - Ensure join table defaults correctly when 'mappedby' not specified ! public void testOneToManyDefaultJoinTableName() { ! Department dept = new Department(); ! Employee manager = new Employee(); ! dept.addManager(manager); ! ! EntityManager em = createEntityManager(); ! try { ! em.getTransaction().begin(); ! em.persist(dept); ! em.getTransaction().commit(); ! }catch (RuntimeException e) { ! throw e; ! }finally { ! if (em.getTransaction().isActive()){ ! em.getTransaction().rollback(); ! } ! em.close(); ! } ! } ! public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); ================================================================================ Merge Diffs: /ade/lhillis_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/CollectionAccessor.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.6 Report generated at Thu Dec 7 09:18:35 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.6 Wed Dec 6 16:18:37 2006 --- /ade/lhillis_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/CollectionAccessor.java Thu Dec 7 09:18:34 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors; import java.util.Collection; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors; import java.util.Collection; *************** *** 200,208 **** * Process a MetadataJoinTable. */ protected void processJoinTable(MetadataJoinTable joinTable, ManyToManyMapping mapping) { ! // Build the default table name ! String sourceName = Helper.getShortClassName(getJavaClassName()).toUpperCase(); ! String targetName = Helper.getShortClassName(getReferenceClassName()).toUpperCase(); String defaultName = sourceName + "_" + targetName; // Name could be "", need to check against the default name. --- 200,208 ---- * Process a MetadataJoinTable. */ protected void processJoinTable(MetadataJoinTable joinTable, ManyToManyMapping mapping) { ! // Build the default table name (gf 1217 - altered to use user defined names) ! String sourceName = m_descriptor.getPrimaryTableName(); ! String targetName = getReferenceDescriptor().getPrimaryTableName(); String defaultName = sourceName + "_" + targetName; // Name could be "", need to check against the default name. *************** *** 225,231 **** if (getReferenceDescriptor().hasBiDirectionalManyToManyAccessorFor(getJavaClassName(), getAttributeName())) { defaultSourceFieldName = getReferenceDescriptor().getBiDirectionalManyToManyAccessor(getJavaClassName(), getAttributeName()).getAttributeName(); } else { ! defaultSourceFieldName = Helper.getShortClassName(getJavaClass().getName()); } addManyToManyRelationKeyFields(joinTable.getJoinColumns(), mapping, defaultSourceFieldName, m_descriptor, true); --- 225,231 ---- if (getReferenceDescriptor().hasBiDirectionalManyToManyAccessorFor(getJavaClassName(), getAttributeName())) { defaultSourceFieldName = getReferenceDescriptor().getBiDirectionalManyToManyAccessor(getJavaClassName(), getAttributeName()).getAttributeName(); } else { ! defaultSourceFieldName = m_descriptor.getAlias(); } addManyToManyRelationKeyFields(joinTable.getJoinColumns(), mapping, defaultSourceFieldName, m_descriptor, true); ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/ExecuteUpdateTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:17:22 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/ExecuteUpdateTest.java Thu Dec 7 11:06:53 2006 *************** *** 8,13 **** --- 8,14 ---- import oracle.toplink.essentials.testing.models.cmp3.fieldaccess.relationships.*; import oracle.toplink.essentials.testing.tests.cmp3.EntityContainerTestBase; import oracle.toplink.essentials.exceptions.QueryException; + import javax.persistence.RollbackException; /* * Tests for the executeUpdate method on the EJBQueryImpl class *************** *** 29,34 **** --- 30,36 ---- protected String nameChange3 = "New Name3"; protected String returnedName1,returnedName2,returnedName3 = null; protected Exception expectedException =null; + protected RollbackException expectedException2 = null; public ExecuteUpdateTest() { } *************** *** 111,123 **** expectedException=expected; } commitTransaction(); ! } catch (Exception ex) { - try{ - commitTransaction(); - }catch(Exception comitEx){} throw new TestErrorException("Exception thrown while executing updates" + ex, ex); } } --- 113,129 ---- expectedException=expected; } + try { commitTransaction(); ! expectedException2 = null; ! }catch(RollbackException ex){ ! expectedException2 = ex; ! } ! } catch (Exception ex) { throw new TestErrorException("Exception thrown while executing updates" + ex, ex); + } finally { + rollbackTransaction(); } } *************** *** 131,137 **** if ( (returnedName3==null || !returnedName3.equals(nameChange3))){ throw new TestErrorException("Customer name did not get updated correctly should be:"+nameChange3 +" is :"+returnedName3); } ! if ( expectedException==null) throw new TestErrorException("excuteUpdate did not result in an exception on findAllCustomersFieldAccess named ReadAllQuery"); } } --- 137,147 ---- if ( (returnedName3==null || !returnedName3.equals(nameChange3))){ throw new TestErrorException("Customer name did not get updated correctly should be:"+nameChange3 +" is :"+returnedName3); } ! if ( expectedException==null) { throw new TestErrorException("excuteUpdate did not result in an exception on findAllCustomersFieldAccess named ReadAllQuery"); + } + if ( expectedException2==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } } } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetResultListTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:18:24 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetResultListTest.java Thu Dec 7 11:06:53 2006 *************** *** 11,16 **** --- 11,17 ---- import oracle.toplink.essentials.testing.framework.*; import oracle.toplink.essentials.testing.models.cmp3.fieldaccess.relationships.*; import java.util.List; + import javax.persistence.RollbackException; /* * Tests using the 'getSingleResult' api on a Query object obtained from the EntityManager * Also tests bugs 4300879 - check non List container policy error *************** *** 26,31 **** --- 27,33 ---- public Integer[] cusIDs = new Integer[3]; + protected RollbackException expectedException3 = null; public GetResultListTest() { } *************** *** 68,79 **** expectedException2 = exceptionExpected2; } - commitTransaction(); - }catch (Exception unexpectedException){ try{ commitTransaction(); ! }catch(Exception comitEx){} throw new TestErrorException("Problem in GetResultListTest: "+unexpectedException); } } --- 70,86 ---- expectedException2 = exceptionExpected2; } try{ commitTransaction(); ! expectedException3 = null; ! }catch(RollbackException ex){ ! expectedException3 = ex; ! } ! ! }catch (Exception unexpectedException){ throw new TestErrorException("Problem in GetResultListTest: "+unexpectedException); + }finally{ + rollbackTransaction(); } } *************** *** 90,95 **** --- 97,105 ---- if ( expectedException2==null || (expectedException2.getErrorCode()!= QueryException.INCORRECT_QUERY_FOUND)){ throw new TestErrorException("getResultList on ReadObjectQuery did not throw expected INCORRECT_QUERY_FOUNDQueryException"); } + if ( expectedException3==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } } } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetSingleResultTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:19:31 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetSingleResultTest.java Thu Dec 7 11:06:53 2006 *************** *** 4,9 **** --- 4,10 ---- import javax.persistence.NoResultException; import javax.persistence.NonUniqueResultException; import javax.persistence.Query; + import javax.persistence.RollbackException; import oracle.toplink.essentials.exceptions.QueryException; import oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl; import oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl; *************** *** 30,35 **** --- 31,37 ---- protected NonUniqueResultException expectedException1 = null; protected NoResultException expectedException2 = null; protected QueryException expectedException3 = null; + protected RollbackException expectedException4 = null; protected String searchString = "notAnItemName"; *************** *** 118,129 **** query4.setDatabaseQuery(readObjectQuery); returnedCustomer2 = (Customer)query4.getSingleResult(); - commitTransaction(); - }catch (Exception unexpectedException){ try{ commitTransaction(); ! }catch(Exception comitEx){} throw new TestErrorException("Problem in GetSingleResultTest: "+unexpectedException); } } --- 120,136 ---- query4.setDatabaseQuery(readObjectQuery); returnedCustomer2 = (Customer)query4.getSingleResult(); try{ commitTransaction(); ! expectedException4 = null; ! }catch(RollbackException ex){ ! expectedException4 = ex; ! } ! ! }catch (Exception unexpectedException){ throw new TestErrorException("Problem in GetSingleResultTest: "+unexpectedException); + }finally{ + rollbackTransaction(); } } *************** *** 137,142 **** --- 144,152 ---- if ( ( expectedException3==null ) || ( expectedException3.getErrorCode()!= QueryException.INVALID_CONTAINER_CLASS ) ){ throw new TestErrorException("getSingelResult using ReadAllQuery with MapContainerPolicy did not throw expected INVALID_CONTAINER_CLASS QueryException"); } + if ( expectedException4==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } if ( returnedCustomer1==null || (!returnedCustomer1.getCustomerId().equals(cusIDs[0])) ){ throw new TestErrorException("Incorrect Single Customer returned, found: "+returnedCustomer1); } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/fieldaccess/relationships/RelationshipsTableManager.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:41:21 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/fieldaccess/relationships/RelationshipsTableManager.java Thu Dec 7 11:06:53 2006 *************** *** 346,352 **** // SECTION: FIELD FieldDefinition field = new FieldDefinition(); ! field.setName("CUSTOMER_CUST_ID"); field.setTypeName("NUMERIC"); field.setSize(15); field.setShouldAllowNull(false); --- 346,352 ---- // SECTION: FIELD FieldDefinition field = new FieldDefinition(); ! field.setName("FieldAccessCustomer_CUST_ID"); field.setTypeName("NUMERIC"); field.setSize(15); field.setShouldAllowNull(false); ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/AdvancedTableCreator.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.14 Thu Dec 7 09:14:15 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/AdvancedTableCreator.java Thu Dec 7 11:06:53 2006 *************** *** 40,45 **** --- 40,46 ---- addTableDefinition(buildPLATINUMBUYERTable()); addTableDefinition(buildBUYERTable()); addTableDefinition(buildDEPTTable()); + addTableDefinition(buildDEPT_EMPTable()); } public static TableDefinition buildADDRESSTable() { *************** *** 675,678 **** --- 676,711 ---- return table; } + + public static TableDefinition buildDEPT_EMPTable() { + TableDefinition table = new TableDefinition(); + table.setName("CMP3_DEPT_CMP3_EMPLOYEE"); + + // SECTION: FIELD + oracle.toplink.essentials.tools.schemaframework.FieldDefinition fieldID = new oracle.toplink.essentials.tools.schemaframework.FieldDefinition(); + fieldID.setName("ADV_DEPT_ID"); + fieldID.setTypeName("NUMERIC"); + fieldID.setSize(15); + fieldID.setShouldAllowNull(false); + fieldID.setIsPrimaryKey(true); + fieldID.setUnique(false); + fieldID.setIsIdentity(false); + fieldID.setForeignKeyFieldName("CMP3_DEPT.ID"); + table.addField(fieldID); + + // SECTION: FIELD + oracle.toplink.essentials.tools.schemaframework.FieldDefinition fieldEMP = new oracle.toplink.essentials.tools.schemaframework.FieldDefinition(); + fieldEMP.setName("MANAGERS_EMP_ID"); + fieldEMP.setTypeName("NUMERIC"); + fieldEMP.setSize(15); + fieldEMP.setShouldAllowNull(false); + fieldEMP.setIsPrimaryKey(true); + fieldEMP.setUnique(false); + fieldEMP.setIsIdentity(false); + fieldEMP.setForeignKeyFieldName("CMP3_EMPLOYEE.EMP_ID"); + table.addField(fieldEMP); + + return table; + } + } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/Department.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:53:18 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/Department.java Thu Dec 7 11:06:53 2006 *************** *** 47,52 **** --- 47,53 ---- private Integer id; private String name; private Collection employees; + private Collection managers; public Department() { this(""); *************** *** 54,59 **** --- 55,61 ---- public Department(String name) { this.name = name; + managers = new Vector(); } @Id *************** *** 89,92 **** --- 91,110 ---- public void setEmployees(Collection employees) { this.employees = employees; } + + //To test default 1-M mapping + @OneToMany(fetch=EAGER, cascade=PERSIST) + public Collection getManagers() { + return managers; + } + + public void setManagers(Collection managers) { + this.managers = managers; + } + + public void addManager(Employee employee) { + if (employee != null && managers != null && !managers.contains(employee)) { + this.managers.add(employee); + } + } } \ No newline at end of file ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.61 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.61 Wed Dec 6 15:59:48 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java Thu Dec 7 11:06:53 2006 *************** *** 3668,3674 **** fail(errorMsg); } } ! public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); --- 3668,3695 ---- fail(errorMsg); } } ! ! //gf 1217 - Ensure join table defaults correctly when 'mappedby' not specified ! public void testOneToManyDefaultJoinTableName() { ! Department dept = new Department(); ! Employee manager = new Employee(); ! dept.addManager(manager); ! ! EntityManager em = createEntityManager(); ! try { ! em.getTransaction().begin(); ! em.persist(dept); ! em.getTransaction().commit(); ! }catch (RuntimeException e) { ! throw e; ! }finally { ! if (em.getTransaction().isActive()){ ! em.getTransaction().rollback(); ! } ! em.close(); ! } ! } ! public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); ================================================================================ Merge Diffs: /ade/lhillis_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/CollectionAccessor.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.6 Report generated at Thu Dec 7 11:06:53 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.6 Wed Dec 6 16:18:37 2006 --- /ade/lhillis_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/CollectionAccessor.java Thu Dec 7 11:06:53 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors; import java.util.Collection; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors; import java.util.Collection; *************** *** 200,208 **** * Process a MetadataJoinTable. */ protected void processJoinTable(MetadataJoinTable joinTable, ManyToManyMapping mapping) { ! // Build the default table name ! String sourceName = Helper.getShortClassName(getJavaClassName()).toUpperCase(); ! String targetName = Helper.getShortClassName(getReferenceClassName()).toUpperCase(); String defaultName = sourceName + "_" + targetName; // Name could be "", need to check against the default name. --- 200,208 ---- * Process a MetadataJoinTable. */ protected void processJoinTable(MetadataJoinTable joinTable, ManyToManyMapping mapping) { ! // Build the default table name (gf 1217 - altered to use user defined names) ! String sourceName = m_descriptor.getPrimaryTableName(); ! String targetName = getReferenceDescriptor().getPrimaryTableName(); String defaultName = sourceName + "_" + targetName; // Name could be "", need to check against the default name. *************** *** 225,231 **** if (getReferenceDescriptor().hasBiDirectionalManyToManyAccessorFor(getJavaClassName(), getAttributeName())) { defaultSourceFieldName = getReferenceDescriptor().getBiDirectionalManyToManyAccessor(getJavaClassName(), getAttributeName()).getAttributeName(); } else { ! defaultSourceFieldName = Helper.getShortClassName(getJavaClass().getName()); } addManyToManyRelationKeyFields(joinTable.getJoinColumns(), mapping, defaultSourceFieldName, m_descriptor, true); --- 225,231 ---- if (getReferenceDescriptor().hasBiDirectionalManyToManyAccessorFor(getJavaClassName(), getAttributeName())) { defaultSourceFieldName = getReferenceDescriptor().getBiDirectionalManyToManyAccessor(getJavaClassName(), getAttributeName()).getAttributeName(); } else { ! defaultSourceFieldName = m_descriptor.getAlias(); } addManyToManyRelationKeyFields(joinTable.getJoinColumns(), mapping, defaultSourceFieldName, m_descriptor, true); ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/ExecuteUpdateTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:14:46 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000001/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:17:22 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/ExecuteUpdateTest.java Thu Dec 7 11:06:53 2006 *************** *** 8,13 **** --- 8,14 ---- import oracle.toplink.essentials.testing.models.cmp3.fieldaccess.relationships.*; import oracle.toplink.essentials.testing.tests.cmp3.EntityContainerTestBase; import oracle.toplink.essentials.exceptions.QueryException; + import javax.persistence.RollbackException; /* * Tests for the executeUpdate method on the EJBQueryImpl class *************** *** 29,34 **** --- 30,36 ---- protected String nameChange3 = "New Name3"; protected String returnedName1,returnedName2,returnedName3 = null; protected Exception expectedException =null; + protected RollbackException expectedException2 = null; public ExecuteUpdateTest() { } *************** *** 111,123 **** expectedException=expected; } commitTransaction(); ! } catch (Exception ex) { - try{ - commitTransaction(); - }catch(Exception comitEx){} throw new TestErrorException("Exception thrown while executing updates" + ex, ex); } } --- 113,129 ---- expectedException=expected; } + try { commitTransaction(); ! expectedException2 = null; ! }catch(RollbackException ex){ ! expectedException2 = ex; ! } ! } catch (Exception ex) { throw new TestErrorException("Exception thrown while executing updates" + ex, ex); + } finally { + rollbackTransaction(); } } *************** *** 131,137 **** if ( (returnedName3==null || !returnedName3.equals(nameChange3))){ throw new TestErrorException("Customer name did not get updated correctly should be:"+nameChange3 +" is :"+returnedName3); } ! if ( expectedException==null) throw new TestErrorException("excuteUpdate did not result in an exception on findAllCustomersFieldAccess named ReadAllQuery"); } } --- 137,147 ---- if ( (returnedName3==null || !returnedName3.equals(nameChange3))){ throw new TestErrorException("Customer name did not get updated correctly should be:"+nameChange3 +" is :"+returnedName3); } ! if ( expectedException==null) { throw new TestErrorException("excuteUpdate did not result in an exception on findAllCustomersFieldAccess named ReadAllQuery"); + } + if ( expectedException2==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } } } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetResultListTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:14:46 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000002/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:18:24 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetResultListTest.java Thu Dec 7 11:06:53 2006 *************** *** 11,16 **** --- 11,17 ---- import oracle.toplink.essentials.testing.framework.*; import oracle.toplink.essentials.testing.models.cmp3.fieldaccess.relationships.*; import java.util.List; + import javax.persistence.RollbackException; /* * Tests using the 'getSingleResult' api on a Query object obtained from the EntityManager * Also tests bugs 4300879 - check non List container policy error *************** *** 26,31 **** --- 27,33 ---- public Integer[] cusIDs = new Integer[3]; + protected RollbackException expectedException3 = null; public GetResultListTest() { } *************** *** 68,79 **** expectedException2 = exceptionExpected2; } - commitTransaction(); - }catch (Exception unexpectedException){ try{ commitTransaction(); ! }catch(Exception comitEx){} throw new TestErrorException("Problem in GetResultListTest: "+unexpectedException); } } --- 70,86 ---- expectedException2 = exceptionExpected2; } try{ commitTransaction(); ! expectedException3 = null; ! }catch(RollbackException ex){ ! expectedException3 = ex; ! } ! ! }catch (Exception unexpectedException){ throw new TestErrorException("Problem in GetResultListTest: "+unexpectedException); + }finally{ + rollbackTransaction(); } } *************** *** 90,95 **** --- 97,105 ---- if ( expectedException2==null || (expectedException2.getErrorCode()!= QueryException.INCORRECT_QUERY_FOUND)){ throw new TestErrorException("getResultList on ReadObjectQuery did not throw expected INCORRECT_QUERY_FOUNDQueryException"); } + if ( expectedException3==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } } } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetSingleResultTest.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:14:46 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000003/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:19:31 2006 --- /ade/lhillis_main/tltest/source/essentials/oracle/toplink/essentials/testing/tests/cmp3/fieldaccess/relationships/GetSingleResultTest.java Thu Dec 7 11:06:53 2006 *************** *** 4,9 **** --- 4,10 ---- import javax.persistence.NoResultException; import javax.persistence.NonUniqueResultException; import javax.persistence.Query; + import javax.persistence.RollbackException; import oracle.toplink.essentials.exceptions.QueryException; import oracle.toplink.essentials.internal.ejb.cmp3.EJBQueryImpl; import oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl; *************** *** 30,35 **** --- 31,37 ---- protected NonUniqueResultException expectedException1 = null; protected NoResultException expectedException2 = null; protected QueryException expectedException3 = null; + protected RollbackException expectedException4 = null; protected String searchString = "notAnItemName"; *************** *** 118,129 **** query4.setDatabaseQuery(readObjectQuery); returnedCustomer2 = (Customer)query4.getSingleResult(); - commitTransaction(); - }catch (Exception unexpectedException){ try{ commitTransaction(); ! }catch(Exception comitEx){} throw new TestErrorException("Problem in GetSingleResultTest: "+unexpectedException); } } --- 120,136 ---- query4.setDatabaseQuery(readObjectQuery); returnedCustomer2 = (Customer)query4.getSingleResult(); try{ commitTransaction(); ! expectedException4 = null; ! }catch(RollbackException ex){ ! expectedException4 = ex; ! } ! ! }catch (Exception unexpectedException){ throw new TestErrorException("Problem in GetSingleResultTest: "+unexpectedException); + }finally{ + rollbackTransaction(); } } *************** *** 137,142 **** --- 144,152 ---- if ( ( expectedException3==null ) || ( expectedException3.getErrorCode()!= QueryException.INVALID_CONTAINER_CLASS ) ){ throw new TestErrorException("getSingelResult using ReadAllQuery with MapContainerPolicy did not throw expected INVALID_CONTAINER_CLASS QueryException"); } + if ( expectedException4==null ){ + throw new TestErrorException("commit did not throw expected RollbackException"); + } if ( returnedCustomer1==null || (!returnedCustomer1.getCustomerId().equals(cusIDs[0])) ){ throw new TestErrorException("Incorrect Single Customer returned, found: "+returnedCustomer1); } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/fieldaccess/relationships/RelationshipsTableManager.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:14:46 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000004/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:41:21 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/fieldaccess/relationships/RelationshipsTableManager.java Thu Dec 7 11:06:53 2006 *************** *** 346,352 **** // SECTION: FIELD FieldDefinition field = new FieldDefinition(); ! field.setName("CUSTOMER_CUST_ID"); field.setTypeName("NUMERIC"); field.setSize(15); field.setShouldAllowNull(false); --- 346,352 ---- // SECTION: FIELD FieldDefinition field = new FieldDefinition(); ! field.setName("FieldAccessCustomer_CUST_ID"); field.setTypeName("NUMERIC"); field.setSize(15); field.setShouldAllowNull(false); ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/AdvancedTableCreator.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.14 Report generated at Thu Dec 7 11:14:47 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000005/AB0952363AC40CBFE034080020E8C54E.14 Thu Dec 7 09:14:15 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/AdvancedTableCreator.java Thu Dec 7 11:06:53 2006 *************** *** 40,45 **** --- 40,46 ---- addTableDefinition(buildPLATINUMBUYERTable()); addTableDefinition(buildBUYERTable()); addTableDefinition(buildDEPTTable()); + addTableDefinition(buildDEPT_EMPTable()); } public static TableDefinition buildADDRESSTable() { *************** *** 675,678 **** --- 676,711 ---- return table; } + + public static TableDefinition buildDEPT_EMPTable() { + TableDefinition table = new TableDefinition(); + table.setName("CMP3_DEPT_CMP3_EMPLOYEE"); + + // SECTION: FIELD + oracle.toplink.essentials.tools.schemaframework.FieldDefinition fieldID = new oracle.toplink.essentials.tools.schemaframework.FieldDefinition(); + fieldID.setName("ADV_DEPT_ID"); + fieldID.setTypeName("NUMERIC"); + fieldID.setSize(15); + fieldID.setShouldAllowNull(false); + fieldID.setIsPrimaryKey(true); + fieldID.setUnique(false); + fieldID.setIsIdentity(false); + fieldID.setForeignKeyFieldName("CMP3_DEPT.ID"); + table.addField(fieldID); + + // SECTION: FIELD + oracle.toplink.essentials.tools.schemaframework.FieldDefinition fieldEMP = new oracle.toplink.essentials.tools.schemaframework.FieldDefinition(); + fieldEMP.setName("MANAGERS_EMP_ID"); + fieldEMP.setTypeName("NUMERIC"); + fieldEMP.setSize(15); + fieldEMP.setShouldAllowNull(false); + fieldEMP.setIsPrimaryKey(true); + fieldEMP.setUnique(false); + fieldEMP.setIsIdentity(false); + fieldEMP.setForeignKeyFieldName("CMP3_EMPLOYEE.EMP_ID"); + table.addField(fieldEMP); + + return table; + } + } ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/Department.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.1 Report generated at Thu Dec 7 11:14:47 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000006/AB0952363AC40CBFE034080020E8C54E.1 Wed Dec 6 15:53:18 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/models/cmp3/advanced/Department.java Thu Dec 7 11:06:53 2006 *************** *** 47,52 **** --- 47,53 ---- private Integer id; private String name; private Collection employees; + private Collection managers; public Department() { this(""); *************** *** 54,59 **** --- 55,61 ---- public Department(String name) { this.name = name; + managers = new Vector(); } @Id *************** *** 89,92 **** --- 91,110 ---- public void setEmployees(Collection employees) { this.employees = employees; } + + //To test default 1-M mapping + @OneToMany(fetch=EAGER, cascade=PERSIST) + public Collection getManagers() { + return managers; + } + + public void setManagers(Collection managers) { + this.managers = managers; + } + + public void addManager(Employee employee) { + if (employee != null && managers != null && !managers.contains(employee)) { + this.managers.add(employee); + } + } } \ No newline at end of file ================================================================================ Merge Diffs: /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.61 Report generated at Thu Dec 7 11:14:47 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000007/AB0952363AC40CBFE034080020E8C54E.61 Wed Dec 6 15:59:48 2006 --- /ade/lhillis_main/tltest/source/entity-persistence-tests/src/java/oracle/toplink/essentials/testing/tests/cmp3/advanced/EntityManagerJUnitTestSuite.java Thu Dec 7 11:06:53 2006 *************** *** 3668,3674 **** fail(errorMsg); } } ! public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); --- 3668,3695 ---- fail(errorMsg); } } ! ! //gf 1217 - Ensure join table defaults correctly when 'mappedby' not specified ! public void testOneToManyDefaultJoinTableName() { ! Department dept = new Department(); ! Employee manager = new Employee(); ! dept.addManager(manager); ! ! EntityManager em = createEntityManager(); ! try { ! em.getTransaction().begin(); ! em.persist(dept); ! em.getTransaction().commit(); ! }catch (RuntimeException e) { ! throw e; ! }finally { ! if (em.getTransaction().isActive()){ ! em.getTransaction().rollback(); ! } ! em.close(); ! } ! } ! public static void main(String[] args) { // Now run JUnit. junit.swingui.TestRunner.main(args); ================================================================================ Merge Diffs: /ade/lhillis_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/CollectionAccessor.java vs. /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.6 Report generated at Thu Dec 7 11:14:47 2006 -------------------------------------------------------------------------------- *** /net/stottnfs2.ca.oracle.com/vol/vol1/ade_ottawa_txn/lhillis/lhillis_gf1217_061206/ade_storage/000008/AB0952363AC40CBFE034080020E8C54E.6 Wed Dec 6 16:18:37 2006 --- /ade/lhillis_main/tldev/source/essentials/oracle/toplink/essentials/internal/ejb/cmp3/metadata/accessors/CollectionAccessor.java Thu Dec 7 11:06:53 2006 *************** *** 18,24 **** * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors; import java.util.Collection; --- 18,24 ---- * own identifying information: Portions Copyright [yyyy] * [name of copyright owner] */ ! // Copyright (c) 1998, 2006, Oracle. All rights reserved. package oracle.toplink.essentials.internal.ejb.cmp3.metadata.accessors; import java.util.Collection; *************** *** 200,208 **** * Process a MetadataJoinTable. */ protected void processJoinTable(MetadataJoinTable joinTable, ManyToManyMapping mapping) { ! // Build the default table name ! String sourceName = Helper.getShortClassName(getJavaClassName()).toUpperCase(); ! String targetName = Helper.getShortClassName(getReferenceClassName()).toUpperCase(); String defaultName = sourceName + "_" + targetName; // Name could be "", need to check against the default name. --- 200,208 ---- * Process a MetadataJoinTable. */ protected void processJoinTable(MetadataJoinTable joinTable, ManyToManyMapping mapping) { ! // Build the default table name (gf 1217 - altered to use user defined names) ! String sourceName = m_descriptor.getPrimaryTableName(); ! String targetName = getReferenceDescriptor().getPrimaryTableName(); String defaultName = sourceName + "_" + targetName; // Name could be "", need to check against the default name. *************** *** 225,231 **** if (getReferenceDescriptor().hasBiDirectionalManyToManyAccessorFor(getJavaClassName(), getAttributeName())) { defaultSourceFieldName = getReferenceDescriptor().getBiDirectionalManyToManyAccessor(getJavaClassName(), getAttributeName()).getAttributeName(); } else { ! defaultSourceFieldName = Helper.getShortClassName(getJavaClass().getName()); } addManyToManyRelationKeyFields(joinTable.getJoinColumns(), mapping, defaultSourceFieldName, m_descriptor, true); --- 225,231 ---- if (getReferenceDescriptor().hasBiDirectionalManyToManyAccessorFor(getJavaClassName(), getAttributeName())) { defaultSourceFieldName = getReferenceDescriptor().getBiDirectionalManyToManyAccessor(getJavaClassName(), getAttributeName()).getAttributeName(); } else { ! defaultSourceFieldName = m_descriptor.getAlias(); } addManyToManyRelationKeyFields(joinTable.getJoinColumns(), mapping, defaultSourceFieldName, m_descriptor, true);