Search in sources :

Example 11 with EmployeeSystem

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

the class FeatureTestModel method addRequiredSystems.

@Override
public void addRequiredSystems() {
    addRequiredSystem(new EmployeeSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.aggregate.AggregateSystem());
    addRequiredSystem(new InheritanceSystem());
    addRequiredSystem(new InsuranceSystem());
    addRequiredSystem(new OwnershipSystem());
    addRequiredSystem(new LegacySystem());
    addRequiredSystem(new EventHookSystem());
    addRequiredSystem(new ProjectSystem());
    addRequiredSystem(new IdentitySystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.collections.CollectionsSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.mapping.MappingSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.sequencing.SequenceTestSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.tests.queries.report.ReportQuerySystem());
    addRequiredSystem(new org.eclipse.persistence.testing.tests.queries.options.QueryOptionSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.bigbad.BigBadSystem());
    addRequiredSystem(new org.eclipse.persistence.testing.models.vehicle.VehicleSystem());
    // Force field names to upper case for custom SQL tests on postgres.
    if (getSession().getPlatform().isPostgreSQL()) {
        getSession().getPlatform().setShouldForceFieldNamesToUpperCase(true);
    }
}
Also used : ProjectSystem(org.eclipse.persistence.testing.models.multipletable.ProjectSystem) InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) org.eclipse.persistence.testing.tests.queries.options(org.eclipse.persistence.testing.tests.queries.options) InsuranceSystem(org.eclipse.persistence.testing.models.insurance.InsuranceSystem) EventHookSystem(org.eclipse.persistence.testing.models.events.EventHookSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 12 with EmployeeSystem

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

the class JDBCBatchUpdatesTestModel method addForcedRequiredSystems.

@Override
public void addForcedRequiredSystems() {
    DatabasePlatform platform = getSession().getPlatform();
    wasBatchWriting = platform.usesBatchWriting();
    wasJDBCBatchWriting = platform.usesJDBCBatchWriting();
    wasParameterBinding = getSession().getLogin().shouldBindAllParameters();
    try {
        getSession().getLog().write("WARNING, some JDBC drivers may fail BatchUpdates.");
    } catch (java.io.IOException e) {
    }
    platform.setUsesBatchWriting(true);
    platform.setUsesJDBCBatchWriting(true);
    getSession().getLogin().dontBindAllParameters();
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    // Force the database to be recreated to ensure the sequences are defined.
    addForcedRequiredSystem(new EmployeeSystem());
    addForcedRequiredSystem(new OptimisticLockingSystem());
    addForcedRequiredSystem(new BarSystem());
}
Also used : OptimisticLockingSystem(org.eclipse.persistence.testing.models.optimisticlocking.OptimisticLockingSystem) BarSystem(org.eclipse.persistence.testing.tests.optimisticlocking.cascaded.BarSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 13 with EmployeeSystem

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

the class NativeBatchWritingTestModel method addForcedRequiredSystems.

@Override
public void addForcedRequiredSystems() {
    DatabasePlatform platform = getSession().getPlatform();
    try {
        getSession().getLog().write("WARNING, some JDBC drivers may fail BatchUpdates.");
    } catch (java.io.IOException e) {
    }
    this.usesBinding = platform.shouldBindAllParameters();
    if (!platform.isOracle()) {
        throw new TestWarningException("Native batch writing is not supported on this database.");
    } else {
        platform.setUsesBatchWriting(true);
        platform.setShouldBindAllParameters(true);
        platform.setShouldCacheAllStatements(true);
        platform.setUsesJDBCBatchWriting(true);
        platform.setUsesNativeBatchWriting(true);
        platform.setMaxBatchWritingSize(100);
    }
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    // Force the database to be recreated to ensure the sequences are defined.
    addForcedRequiredSystem(new EmployeeSystem());
}
Also used : DatabasePlatform(org.eclipse.persistence.internal.databaseaccess.DatabasePlatform) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 14 with EmployeeSystem

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

the class NativeModeCreatorTestModel method addForcedRequiredSystems.

/**
 * This sets the table qualifier and native mode.
 */
@Override
public void addForcedRequiredSystems() {
    DatabasePlatform platform = getSession().getPlatform();
    usesNativeSQL = platform.usesNativeSQL();
    defaultSequence = getSession().getLogin().getDefaultSequence();
    shouldBindAllParameters = platform.shouldBindAllParameters();
    if (platform.isSybase() || platform.isSQLAnywhere() || platform.isOracle() || platform.isSQLServer() || platform.isInformix() || platform.isMySQL() || platform.isDB2() || platform.isTimesTen() || platform.isSymfoware()) {
        platform.setUsesNativeSQL(true);
        getSession().getLogin().useNativeSequencing();
        getDatabaseSession().getSequencingControl().resetSequencing();
    }
    // We need to disable binding for testing native SQL.
    platform.setShouldBindAllParameters(false);
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    // Force the database to be recreated to ensure the sequences are defined.
    addForcedRequiredSystem(new EmployeeNativeModeSystem());
    getExecutor().removeConfigureSystem(new InheritanceSystem());
    addForcedRequiredSystem(new InheritanceSystem());
}
Also used : InheritanceSystem(org.eclipse.persistence.testing.models.inheritance.InheritanceSystem) EmployeeSystem(org.eclipse.persistence.testing.models.employee.relational.EmployeeSystem)

Example 15 with EmployeeSystem

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

the class ParameterizedBatchUpdatesTestModel method addForcedRequiredSystems.

@Override
public void addForcedRequiredSystems() {
    DatabasePlatform platform = getSession().getPlatform();
    wasBatchWriting = platform.usesBatchWriting();
    wasJDBCBatchWriting = platform.usesJDBCBatchWriting();
    wasBinding = platform.shouldBindAllParameters();
    wasStatementCaching = platform.shouldCacheAllStatements();
    try {
        getSession().getLog().write("WARNING, some JDBC drivers may fail BatchUpdates.");
    } catch (java.io.IOException e) {
    }
    platform.setUsesBatchWriting(true);
    platform.setShouldBindAllParameters(true);
    platform.setShouldCacheAllStatements(true);
    platform.setUsesJDBCBatchWriting(true);
    platform.setMaxBatchWritingSize(100);
    getExecutor().removeConfigureSystem(new EmployeeSystem());
    // Force the database to be recreated to ensure the sequences are defined.
    addForcedRequiredSystem(new EmployeeSystem());
}
Also used : 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