Search in sources :

Example 1 with PartnerLinkPopulator

use of org.eclipse.persistence.testing.models.jpa.advanced.PartnerLinkPopulator in project eclipselink by eclipse-ee4j.

the class JUnitJPQLComplexTestSuite method testSetup.

/**
 * The setup is done as a test, both to record its failure, and to allow execution in the server.
 */
public void testSetup() {
    clearCache();
    // get session to start setup
    DatabaseSession session = JUnitTestCase.getServerSession();
    // create a new EmployeePopulator
    EmployeePopulator employeePopulator = new EmployeePopulator();
    // create a new PartnerLinkPopulator
    PartnerLinkPopulator partnerLinkPopulator = new PartnerLinkPopulator();
    new AdvancedTableCreator().replaceTables(session);
    // initialize the global comparer object
    comparer = new JUnitDomainObjectComparer();
    // set the session for the comparer to use
    comparer.setSession((AbstractSession) session.getActiveSession());
    // Populate the tables
    employeePopulator.buildExamples();
    // Persist the examples in the database
    employeePopulator.persistExample(session);
    // Populate the tables
    partnerLinkPopulator.buildExamples();
    // Persist the examples in the database
    partnerLinkPopulator.persistExample(session);
    new InheritedTableManager().replaceTables(session);
    new DataTypesTableCreator().replaceTables(session);
    // create stored function when database supports it
    if (supportsStoredFunctions()) {
        SchemaManager schema = new SchemaManager(session);
        schema.replaceObject(buildStoredFunction());
    }
    new CompositePKTableCreator().replaceTables(JUnitTestCase.getServerSession());
}
Also used : InheritedTableManager(org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager) CompositePKTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator) AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) DataTypesTableCreator(org.eclipse.persistence.testing.models.jpa.datatypes.DataTypesTableCreator) SchemaManager(org.eclipse.persistence.tools.schemaframework.SchemaManager) PartnerLinkPopulator(org.eclipse.persistence.testing.models.jpa.advanced.PartnerLinkPopulator)

Aggregations

DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)1 AdvancedTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator)1 EmployeePopulator (org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator)1 PartnerLinkPopulator (org.eclipse.persistence.testing.models.jpa.advanced.PartnerLinkPopulator)1 CompositePKTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator)1 DataTypesTableCreator (org.eclipse.persistence.testing.models.jpa.datatypes.DataTypesTableCreator)1 InheritedTableManager (org.eclipse.persistence.testing.models.jpa.inherited.InheritedTableManager)1 SchemaManager (org.eclipse.persistence.tools.schemaframework.SchemaManager)1