Search in sources :

Example 26 with EmployeeSystem

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

the class NativeModeCreatorTestModel method reset.

/**
 * This unsets the table qualifier and native mode.
 */
@Override
public void reset() {
    getExecutor().resetSession();
    DatabasePlatform platform = getSession().getPlatform();
    if (platform.isSybase() || platform.isSQLAnywhere() || platform.isOracle() || platform.isSQLServer() || platform.isInformix() || platform.isMySQL() || platform.isDB2() || platform.isTimesTen() || platform.isSymfoware()) {
        if (usesNativeSQL != null) {
            platform.setUsesNativeSQL(usesNativeSQL);
        }
        if (defaultSequence != null) {
            getSession().getLogin().setDefaultSequence(defaultSequence);
            getDatabaseSession().getSequencingControl().resetSequencing();
        }
    }
    if (shouldBindAllParameters != null) {
        platform.setShouldBindAllParameters(shouldBindAllParameters);
    }
    if (qualifier != null) {
        getSession().getLogin().setTableQualifier(qualifier);
    }
    getSession().getIdentityMapAccessor().initializeIdentityMaps();
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    getExecutor().removeConfigureSystem(new InheritanceSystem());
    getDatabaseSession().logout();
    getDatabaseSession().login();
}
Also used : InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 27 with EmployeeSystem

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

the class EmployeeJoinFetchTestModel method addForcedRequiredSystems.

@Override
public void addForcedRequiredSystems() {
    if (getSession().getPlatform().isHSQL()) {
        throw new TestWarningException("HSQL does not support complex outer joins correctly.");
    }
    EmployeeSystem system = new EmployeeSystem();
    ClassDescriptor descriptor = system.project.getClassDescriptor(Employee.class);
    ((ForeignReferenceMapping) descriptor.getMappingForAttributeName("address")).useInnerJoinFetch();
    ((ForeignReferenceMapping) descriptor.getMappingForAttributeName("manager")).useOuterJoinFetch();
    ((ForeignReferenceMapping) descriptor.getMappingForAttributeName("managedEmployees")).useOuterJoinFetch();
    ((ForeignReferenceMapping) descriptor.getMappingForAttributeName("projects")).useOuterJoinFetch();
    ((ForeignReferenceMapping) descriptor.getMappingForAttributeName("phoneNumbers")).useInnerJoinFetch();
    ((ForeignReferenceMapping) descriptor.getMappingForAttributeName("responsibilitiesList")).useOuterJoinFetch();
    addForcedRequiredSystem(system);
}
Also used : ForeignReferenceMapping(org.eclipse.persistence.mappings.ForeignReferenceMapping) ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 28 with EmployeeSystem

use of org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem 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

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