Search in sources :

Example 6 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class DistributedCacheModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new DirectMapMappingsSystem());
}
Also used : DirectMapMappingsSystem(org.eclipse.persistence.testing.models.directmap.DirectMapMappingsSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 7 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class EmployeeChangeFlagBasicTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new CollectionsSystem());
}
Also used : CollectionsSystem(org.eclipse.persistence.testing.models.collections.CollectionsSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 8 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class MultipleClientBrokersTestModel method createTables.

/**
 * This method was created in VisualAge.
 */
public void createTables() {
    SessionBroker broker = new SessionBroker();
    DatabaseSession session1 = new DatabaseSessionImpl(Server.getLogin1());
    DatabaseSession session2 = new DatabaseSessionImpl(Server.getLogin2());
    session1.addDescriptors(new EmployeeProject1());
    session2.addDescriptors(new EmployeeProject2());
    broker.registerSession("broker1", session1);
    broker.registerSession("broker2", session2);
    broker.setLogLevel(getSession().getLogLevel());
    broker.setLog(getSession().getLog());
    broker.login();
    // Set session for join table.
    ((ManyToManyMapping) session1.getDescriptor(Employee.class).getObjectBuilder().getMappingForAttributeName("projects")).setSessionName("broker2");
    // Disable delete verify.
    ((OneToOneMapping) session1.getDescriptor(Employee.class).getObjectBuilder().getMappingForAttributeName("address")).setShouldVerifyDelete(false);
    org.eclipse.persistence.testing.models.employee.relational.EmployeeTableCreator tables = new org.eclipse.persistence.testing.models.employee.relational.EmployeeTableCreator();
    tables.replaceTables(session1);
    tables.replaceTables(session2);
    tables.dropConstraints(session1);
    tables.dropConstraints(session2);
    new org.eclipse.persistence.tools.schemaframework.SchemaManager(session1).createSequences();
    new org.eclipse.persistence.tools.schemaframework.SchemaManager(session2).createSequences();
    new EmployeeSystem().populate(broker);
    broker.logout();
}
Also used : ManyToManyMapping(org.eclipse.persistence.mappings.ManyToManyMapping) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) SessionBroker(org.eclipse.persistence.sessions.broker.SessionBroker) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) DatabaseSessionImpl(org.eclipse.persistence.internal.sessions.DatabaseSessionImpl) OneToOneMapping(org.eclipse.persistence.mappings.OneToOneMapping) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 9 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class AutoTableGeneratorBasicTestModel method addForcedRequiredSystems.

/**
 * Swap a clean session to ensure only the desired descriptors are loaded.
 */
@Override
public void addForcedRequiredSystems() {
    getExecutor().swapCleanDatabaseSession();
    // Must clear the employee system as the tables are replaced.
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    addForcedRequiredSystem(new AutoTableGeneratorEmployeeSystem());
}
Also used : EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 10 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem in project eclipselink by eclipse-ee4j.

the class ClientServerTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    try {
        getSession().getLog().write("WARNING, some JDBC drivers may fail if they are not thread safe." + Helper.cr() + "JDBC-ODBC will not be run for this test." + Helper.cr() + "Oracle OCI may fail." + Helper.cr() + "DB2 IBM JDBC may fail." + Helper.cr());
        getSession().getLog().flush();
    } catch (java.io.IOException e) {
    }
    if (getSession().getLogin().isJDBCODBCBridge()) {
        throw new TestWarningException("JDBC-ODBC cannot support concurrent connections.");
    }
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new InsuranceSystem());
    addRequiredSystem(new ClientServerEmployeeSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.tests.unitofwork.UOWSystem());
}
Also used : InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) org.eclipse.persistence.testing.tests.unitofwork(org.eclipse.persistence.testing.tests.unitofwork) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Aggregations

EmployeeSystem (org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)28 InheritanceSystem (org.eclipse.persistence.testing.models.inheritance.InheritanceSystem)8 InsuranceSystem (org.eclipse.persistence.testing.models.insurance.InsuranceSystem)7 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)5 DatabaseLogin (org.eclipse.persistence.sessions.DatabaseLogin)2 EventHookSystem (org.eclipse.persistence.testing.models.events.EventHookSystem)2 OwnershipSystem (org.eclipse.persistence.testing.models.ownership.OwnershipSystem)2 IndirectListSystem (org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem)2 org.eclipse.persistence.testing.tests.unitofwork (org.eclipse.persistence.testing.tests.unitofwork)2 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)1 EclipseLinkException (org.eclipse.persistence.exceptions.EclipseLinkException)1 DatabasePlatform (org.eclipse.persistence.internal.databaseaccess.DatabasePlatform)1 DatabaseSessionImpl (org.eclipse.persistence.internal.sessions.DatabaseSessionImpl)1 ForeignReferenceMapping (org.eclipse.persistence.mappings.ForeignReferenceMapping)1 ManyToManyMapping (org.eclipse.persistence.mappings.ManyToManyMapping)1 OneToOneMapping (org.eclipse.persistence.mappings.OneToOneMapping)1 TimesTenPlatform (org.eclipse.persistence.platform.database.TimesTenPlatform)1 Project (org.eclipse.persistence.sessions.Project)1 SessionBroker (org.eclipse.persistence.sessions.broker.SessionBroker)1 XMLSessionConfigLoader (org.eclipse.persistence.sessions.factories.XMLSessionConfigLoader)1