Search in sources :

Example 1 with OwnershipSystem

use of org.eclipse.persistence.testing.models.ownership.OwnershipSystem in project eclipselink by eclipse-ee4j.

the class NativeModeCreatorTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new OwnershipSystem());
    addRequiredSystem(new LegacySystem());
    addRequiredSystem(new ProjectSystem());
    addRequiredSystem(new CollectionsSystem());
    addRequiredSystem(new MappingSystem());
    addRequiredSystem(new AggregateSystem());
}
Also used : ProjectSystem(org.eclipse.persistence.testing.models.multipletable.ProjectSystem) LegacySystem(org.eclipse.persistence.testing.models.legacy.LegacySystem) CollectionsSystem(org.eclipse.persistence.testing.models.collections.CollectionsSystem) MappingSystem(org.eclipse.persistence.testing.models.mapping.MappingSystem) OwnershipSystem(org.eclipse.persistence.testing.models.ownership.OwnershipSystem) AggregateSystem(org.eclipse.persistence.testing.models.aggregate.AggregateSystem)

Example 2 with OwnershipSystem

use of org.eclipse.persistence.testing.models.ownership.OwnershipSystem in project eclipselink by eclipse-ee4j.

the class NativeModeCreatorTestModel method setup.

/**
 * This sets the table qualifier and native mode.
 */
@Override
public void setup() {
    getSession().getIdentityMapAccessor().initializeIdentityMaps();
    // Set table qualifier for Oracle, assume user name is schema.
    if (getSession().getLogin().getPlatform().isOracle()) {
        String oldUser = null;
        try {
            oldUser = getAbstractSession().getAccessor().getConnection().getMetaData().getUserName();
        } catch (Exception exception) {
            throw new TestErrorException("Meta-data error.", exception);
        }
        getExecutor().swapCleanDatabaseSession();
        getSession().getLogin().setUserName("scott");
        getSession().getLogin().setPassword("tiger");
        qualifier = getSession().getLogin().getTableQualifier();
        getSession().getLogin().setTableQualifier(oldUser);
        getDatabaseSession().logout();
        DatabaseSession newDBSession = getDatabaseSession();
        new EmployeeNativeModeSystem().addDescriptors(newDBSession);
        new InheritanceSystem().addDescriptors(newDBSession);
        new OwnershipSystem().addDescriptors(newDBSession);
        new LegacySystem().addDescriptors(newDBSession);
        new ProjectSystem().addDescriptors(newDBSession);
        new CollectionsSystem().addDescriptors(newDBSession);
        new MappingSystem().addDescriptors(newDBSession);
        new AggregateSystem().addDescriptors(newDBSession);
        getDatabaseSession().login();
        new EmployeeNativeModeSystem().dropTableConstraints(getSession());
        new InheritanceSystem().dropTableConstraints(getSession());
    }
}
Also used : ProjectSystem(org.eclipse.persistence.testing.models.multipletable.ProjectSystem) LegacySystem(org.eclipse.persistence.testing.models.legacy.LegacySystem) CollectionsSystem(org.eclipse.persistence.testing.models.collections.CollectionsSystem) MappingSystem(org.eclipse.persistence.testing.models.mapping.MappingSystem) OwnershipSystem(org.eclipse.persistence.testing.models.ownership.OwnershipSystem) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) AggregateSystem(org.eclipse.persistence.testing.models.aggregate.AggregateSystem)

Example 3 with OwnershipSystem

use of org.eclipse.persistence.testing.models.ownership.OwnershipSystem in project eclipselink by eclipse-ee4j.

the class CommitOrderTest method test.

@Override
public void test() {
    getSession().getProject().setDescriptors(new HashMap<>());
    ((DatabaseSession) getSession()).logout();
    ((DatabaseSession) getSession()).login();
    new EmployeeSystem().addDescriptors(getDatabaseSession());
    orderAResults = getCommitOrderListAsString(getAbstractSession().getCommitManager().getCommitOrder());
    getSession().getProject().setDescriptors(new HashMap<>());
    ((DatabaseSession) getSession()).logout();
    ((DatabaseSession) getSession()).login();
    new InsuranceSystem().addDescriptors(getDatabaseSession());
    orderBResults = getCommitOrderListAsString(getAbstractSession().getCommitManager().getCommitOrder());
    getSession().getProject().setDescriptors(new HashMap<>());
    ((DatabaseSession) getSession()).logout();
    ((DatabaseSession) getSession()).login();
    new OwnershipSystem().addDescriptors(getDatabaseSession());
    orderCResults = getCommitOrderListAsString(getAbstractSession().getCommitManager().getCommitOrder());
    getSession().getProject().setDescriptors(new HashMap<>());
    ((DatabaseSession) getSession()).logout();
    ((DatabaseSession) getSession()).login();
    new InheritanceSystem().addDescriptors(getDatabaseSession());
    orderDResults = getCommitOrderListAsString(getAbstractSession().getCommitManager().getCommitOrder());
}
Also used : InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) OwnershipSystem(org.eclipse.persistence.testing.models.ownership.OwnershipSystem) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 4 with OwnershipSystem

use of org.eclipse.persistence.testing.models.ownership.OwnershipSystem in project eclipselink by eclipse-ee4j.

the class UnitOfWorkClientSessionTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    // H2 has locking issue with multiple connections.
    if (getSession().getPlatform().isH2()) {
        throw new TestWarningException("H2 has locking issue with multiple connections");
    }
    addRequiredSystem(new OwnershipSystem());
    addRequiredSystem(new IndirectListSystem());
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new InsuranceSystem());
    addRequiredSystem(new MappingSystem());
    addRequiredSystem(new UOWSystem());
    addRequiredSystem(new InheritanceSystem());
}
Also used : InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) MappingSystem(org.eclipse.persistence.testing.models.mapping.MappingSystem) OwnershipSystem(org.eclipse.persistence.testing.models.ownership.OwnershipSystem) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) IndirectListSystem(org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem) TestWarningException(org.eclipse.persistence.testing.framework.TestWarningException) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Aggregations

OwnershipSystem (org.eclipse.persistence.testing.models.ownership.OwnershipSystem)4 InheritanceSystem (org.eclipse.persistence.testing.models.inheritance.InheritanceSystem)3 MappingSystem (org.eclipse.persistence.testing.models.mapping.MappingSystem)3 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)2 AggregateSystem (org.eclipse.persistence.testing.models.aggregate.AggregateSystem)2 CollectionsSystem (org.eclipse.persistence.testing.models.collections.CollectionsSystem)2 EmployeeSystem (org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)2 InsuranceSystem (org.eclipse.persistence.testing.models.insurance.InsuranceSystem)2 LegacySystem (org.eclipse.persistence.testing.models.legacy.LegacySystem)2 ProjectSystem (org.eclipse.persistence.testing.models.multipletable.ProjectSystem)2 TestWarningException (org.eclipse.persistence.testing.framework.TestWarningException)1 IndirectListSystem (org.eclipse.persistence.testing.models.transparentindirection.IndirectListSystem)1