Search in sources :

Example 1 with RelationshipsExamples

use of org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples in project eclipselink by eclipse-ee4j.

the class JUnitJPQLComplexAggregateTestSuite 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();
    new AdvancedTableCreator().replaceTables(session);
    new CompositePKTableCreator().replaceTables(session);
    RelationshipsExamples relationshipExamples = new RelationshipsExamples();
    new RelationshipsTableManager().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 relationships model and persist as well
    relationshipExamples.buildExamples(session);
}
Also used : CompositePKTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator) RelationshipsTableManager(org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager) AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) RelationshipsExamples(org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession)

Example 2 with RelationshipsExamples

use of org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples in project eclipselink by eclipse-ee4j.

the class AdvancedQueryTestSuite 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();
    DatabaseSession session = JUnitTestCase.getServerSession();
    // create a new EmployeePopulator
    EmployeePopulator employeePopulator = new EmployeePopulator();
    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);
    new RelationshipsTableManager().replaceTables(session);
    // populate the relationships model and persist as well
    new RelationshipsExamples().buildExamples(session);
    new InheritanceTableCreator().replaceTables(session);
    InheritancePopulator inheritancePopulator = new InheritancePopulator();
    inheritancePopulator.buildExamples();
    // Persist the examples in the database
    inheritancePopulator.persistExample(session);
}
Also used : RelationshipsTableManager(org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager) AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) RelationshipsExamples(org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) InheritancePopulator(org.eclipse.persistence.testing.models.jpa.inheritance.InheritancePopulator) InheritanceTableCreator(org.eclipse.persistence.testing.models.jpa.inheritance.InheritanceTableCreator)

Example 3 with RelationshipsExamples

use of org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples in project eclipselink by eclipse-ee4j.

the class JUnitJPQLExamplesTestSuite 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();
    RelationshipsExamples relationshipExamples = new RelationshipsExamples();
    new AdvancedTableCreator().replaceTables(session);
    new RelationshipsTableManager().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 advanced model
    employeePopulator.buildExamples();
    // populate the relationships model and persist as well
    relationshipExamples.buildExamples(session);
    // Persist the advanced model examples in the database
    employeePopulator.persistExample(session);
}
Also used : RelationshipsTableManager(org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager) RelationshipsExamples(org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples) AdvancedTableCreator(org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator) EmployeePopulator(org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession)

Aggregations

DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)3 AdvancedTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.AdvancedTableCreator)3 EmployeePopulator (org.eclipse.persistence.testing.models.jpa.advanced.EmployeePopulator)3 RelationshipsExamples (org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsExamples)3 RelationshipsTableManager (org.eclipse.persistence.testing.models.jpa.relationships.RelationshipsTableManager)3 CompositePKTableCreator (org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKTableCreator)1 InheritancePopulator (org.eclipse.persistence.testing.models.jpa.inheritance.InheritancePopulator)1 InheritanceTableCreator (org.eclipse.persistence.testing.models.jpa.inheritance.InheritanceTableCreator)1