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();
}
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);
}
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());
}
Aggregations