use of org.eclipse.persistence.testing.models.jpa.advanced.compositepk.CompositePKPopulator in project eclipselink by eclipse-ee4j.
the class BaseFetchGroupTests method testSetup.
@Test
public void testSetup() {
ServerSession session = getServerSession();
new AdvancedTableCreator().replaceTables(session);
// requires another package
new CompositePKTableCreator().replaceTables(session);
// Force uppercase for Postgres.
if (session.getPlatform().isPostgreSQL()) {
session.getLogin().setShouldForceFieldNamesToUpperCase(true);
}
// The EquipmentCode class 'should' be set to read only. We want
// to be able to create a couple in the Employee populator, so
// force the read only to false. If EquipmentCode is not
// actually read only, don't worry, we set the original read
// only value back on the descriptor and the error will be
// caught in a later test in this suite.
ClassDescriptor descriptor = session.getDescriptor(EquipmentCode.class);
boolean shouldBeReadOnly = descriptor.shouldBeReadOnly();
descriptor.setShouldBeReadOnly(false);
// Populate the database with our examples.
EmployeePopulator employeePopulator = new EmployeePopulator();
employeePopulator.buildExamples();
employeePopulator.persistExample(session);
CompositePKPopulator compositePKPopulator = new CompositePKPopulator();
compositePKPopulator.buildExamples();
compositePKPopulator.persistExample(session);
descriptor.setShouldBeReadOnly(shouldBeReadOnly);
clearCache();
}
Aggregations