Search in sources :

Example 1 with ProjectClassGenerator

use of org.eclipse.persistence.sessions.factories.ProjectClassGenerator in project eclipselink by eclipse-ee4j.

the class ProjectClassGeneratorResultFileTest method test.

/**
 * test() will do a default generation of a project.
 */
@Override
public void test() {
    try {
        ProjectClassGenerator generator = new ProjectClassGenerator(project);
        generator.generate();
        fileName = generator.getOutputFileName();
    } catch (Exception exception) {
        generationException = exception;
    }
}
Also used : ProjectClassGenerator(org.eclipse.persistence.sessions.factories.ProjectClassGenerator) TestErrorException(org.eclipse.persistence.testing.framework.TestErrorException)

Example 2 with ProjectClassGenerator

use of org.eclipse.persistence.sessions.factories.ProjectClassGenerator in project eclipselink by eclipse-ee4j.

the class OptimisticLockingLinesSelectedFieldsLockingPolicyTest method setup.

@Override
protected void setup() {
    getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
    descriptorToModify = project.getDescriptors().get(Employee.class);
    SelectedFieldsLockingPolicy lockingTestPolicy = new SelectedFieldsLockingPolicy();
    lockingTestPolicy.addLockFieldName("testField1");
    lockingTestPolicy.addLockFieldName("testField2");
    descriptorToModify.setOptimisticLockingPolicy(lockingTestPolicy);
    generator = new ProjectClassGenerator(project);
}
Also used : SelectedFieldsLockingPolicy(org.eclipse.persistence.descriptors.SelectedFieldsLockingPolicy) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) ProjectClassGenerator(org.eclipse.persistence.sessions.factories.ProjectClassGenerator)

Example 3 with ProjectClassGenerator

use of org.eclipse.persistence.sessions.factories.ProjectClassGenerator in project eclipselink by eclipse-ee4j.

the class QueryManagerHasReadObjectQueryIsSQLCallQueryTest method setup.

@Override
protected void setup() {
    getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
    project = new org.eclipse.persistence.testing.models.employee.relational.EmployeeProject();
    descriptorToModify = project.getDescriptors().get(Employee.class);
    ReadObjectQuery testReadQuery = new ReadObjectQuery();
    SQLCall testCall = new SQLCall();
    // setting the SQLCall on ReadObject
    testReadQuery.setCall(testCall);
    testReadQuery.setSQLString("testString");
    descriptorToModify.getQueryManager().setReadObjectQuery(testReadQuery);
    generator = new ProjectClassGenerator(project);
}
Also used : SQLCall(org.eclipse.persistence.queries.SQLCall) Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) ReadObjectQuery(org.eclipse.persistence.queries.ReadObjectQuery) ProjectClassGenerator(org.eclipse.persistence.sessions.factories.ProjectClassGenerator)

Example 4 with ProjectClassGenerator

use of org.eclipse.persistence.sessions.factories.ProjectClassGenerator in project eclipselink by eclipse-ee4j.

the class TimestampLockingPolicyUseLocalTimeTest method setup.

@Override
protected void setup() {
    getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
    project = new org.eclipse.persistence.testing.models.employee.relational.EmployeeProject();
    descriptorToModify = project.getDescriptors().get(Employee.class);
    TimestampLockingPolicy lockingTestPolicy = new TimestampLockingPolicy();
    lockingTestPolicy.setUsesServerTime(false);
    lockingTestPolicy.useLocalTime();
    lockingTestPolicy.setWriteLockFieldName("VERSION");
    descriptorToModify.setOptimisticLockingPolicy(lockingTestPolicy);
    generator = new ProjectClassGenerator(project);
}
Also used : Employee(org.eclipse.persistence.testing.models.employee.domain.Employee) TimestampLockingPolicy(org.eclipse.persistence.descriptors.TimestampLockingPolicy) ProjectClassGenerator(org.eclipse.persistence.sessions.factories.ProjectClassGenerator)

Example 5 with ProjectClassGenerator

use of org.eclipse.persistence.sessions.factories.ProjectClassGenerator in project eclipselink by eclipse-ee4j.

the class GettersAndSettersForProjectClassGeneratorTest method setup.

@Override
protected void setup() {
    getSession().getIdentityMapAccessor().initializeAllIdentityMaps();
    project = new org.eclipse.persistence.testing.models.employee.relational.EmployeeProject();
    generator = new ProjectClassGenerator();
}
Also used : ProjectClassGenerator(org.eclipse.persistence.sessions.factories.ProjectClassGenerator)

Aggregations

ProjectClassGenerator (org.eclipse.persistence.sessions.factories.ProjectClassGenerator)10 TestErrorException (org.eclipse.persistence.testing.framework.TestErrorException)4 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)4 SQLCall (org.eclipse.persistence.queries.SQLCall)2 Project (org.eclipse.persistence.sessions.Project)2 SelectedFieldsLockingPolicy (org.eclipse.persistence.descriptors.SelectedFieldsLockingPolicy)1 TimestampLockingPolicy (org.eclipse.persistence.descriptors.TimestampLockingPolicy)1 InsertObjectQuery (org.eclipse.persistence.queries.InsertObjectQuery)1 ReadObjectQuery (org.eclipse.persistence.queries.ReadObjectQuery)1