Search in sources :

Example 21 with Project

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

the class CMPDescriptorPessimisticLockingTest method test.

@Override
protected void test() {
    // test run time project that should contains cusomtom sql queries
    Project project = XMLProjectReader.read(PROJECT_FILE, getClass().getClassLoader());
    ClassDescriptor employeeDescriptor = project.getDescriptors().get(Employee.class);
    ClassDescriptor addressDescriptor = project.getDescriptors().get(Address.class);
    if (!employeeDescriptor.hasPessimisticLockingPolicy()) {
        throw new TestErrorException("'Employee descriptor was not written or read correctly");
    } else if (employeeDescriptor.getCMPPolicy().getPessimisticLockingPolicy().getLockingMode() != ObjectLevelReadQuery.LOCK) {
        throw new TestErrorException("'Employee descriptor was not written or read correctly with pessimistic locking LOCK mode");
    }
    if (!addressDescriptor.hasPessimisticLockingPolicy()) {
        throw new TestErrorException("'Address descriptor was not written or read correctly");
    } else if (addressDescriptor.getCMPPolicy().getPessimisticLockingPolicy().getLockingMode() != ObjectLevelReadQuery.LOCK_NOWAIT) {
        throw new TestErrorException("'Address descriptor was not written or read correctly with pessimistic locking LOCK_NOWAIT mode");
    }
}
Also used : Project(org.eclipse.persistence.sessions.Project) EmployeeProject(org.eclipse.persistence.testing.models.employee.relational.EmployeeProject) ClassDescriptor(org.eclipse.persistence.descriptors.ClassDescriptor) TestErrorException(org.eclipse.persistence.testing.framework.TestErrorException)

Example 22 with Project

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

the class ClassDescriptor method convertClassNamesToClasses.

/**
 * INTERNAL:
 * Convert all the class-name-based settings in this Descriptor to actual class-based
 * settings. This method is used when converting a project that has been built
 * with class names to a project with classes.
 */
public void convertClassNamesToClasses(ClassLoader classLoader) {
    if (getJavaClassName() != null) {
        final Class<?> descriptorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(getJavaClassName(), true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(getJavaClassName(), ex));
        setJavaClass(descriptorClass);
    }
    if (getAmendmentClassName() != null) {
        final Class<?> amendmentClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(getAmendmentClassName(), true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(getAmendmentClassName(), ex));
        setAmendmentClass(amendmentClass);
    }
    if (copyPolicy == null && getCopyPolicyClassName() != null) {
        final Class<?> copyPolicyClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(getCopyPolicyClassName(), true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(getCopyPolicyClassName(), ex));
        final CopyPolicy newCopyPolicy = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> (CopyPolicy) org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(copyPolicyClass), (ex) -> ValidationException.reflectiveExceptionWhileCreatingClassInstance(getCopyPolicyClassName(), ex));
        setCopyPolicy(newCopyPolicy);
    }
    if (this.serializedObjectPolicy != null && this.serializedObjectPolicy instanceof SerializedObjectPolicyWrapper) {
        final String serializedObjectPolicyClassName = ((SerializedObjectPolicyWrapper) this.serializedObjectPolicy).getSerializedObjectPolicyClassName();
        final Class<?> serializedObjectPolicyClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(serializedObjectPolicyClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(serializedObjectPolicyClassName, ex));
        final SerializedObjectPolicy newSerializedObjectPolicy = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> (SerializedObjectPolicy) org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(serializedObjectPolicyClass), (ex) -> ValidationException.reflectiveExceptionWhileCreatingClassInstance(serializedObjectPolicyClassName, ex));
        newSerializedObjectPolicy.setField(this.serializedObjectPolicy.getField());
        setSerializedObjectPolicy(newSerializedObjectPolicy);
    }
    // Create and set default QueryRedirector instances
    if (this.defaultQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultQueryRedirectorClassName, ex));
        setDefaultQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultQueryRedirectorClassName, ex)));
    }
    if (this.defaultReadObjectQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultReadObjectQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultReadObjectQueryRedirectorClassName, ex));
        setDefaultReadObjectQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultReadObjectQueryRedirectorClassName, ex)));
    }
    if (this.defaultReadAllQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultReadAllQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultReadAllQueryRedirectorClassName, ex));
        setDefaultReadAllQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultReadAllQueryRedirectorClassName, ex)));
    }
    if (this.defaultReportQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultReportQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultReportQueryRedirectorClassName, ex));
        setDefaultReportQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultReportQueryRedirectorClassName, ex)));
    }
    if (this.defaultInsertObjectQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultInsertObjectQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultInsertObjectQueryRedirectorClassName, ex));
        setDefaultInsertObjectQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultInsertObjectQueryRedirectorClassName, ex)));
    }
    if (this.defaultUpdateObjectQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultUpdateObjectQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultUpdateObjectQueryRedirectorClassName, ex));
        setDefaultUpdateObjectQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultUpdateObjectQueryRedirectorClassName, ex)));
    }
    if (this.defaultDeleteObjectQueryRedirectorClassName != null) {
        final Class<?> redirectorClass = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(defaultDeleteObjectQueryRedirectorClassName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultDeleteObjectQueryRedirectorClassName, ex));
        setDefaultDeleteObjectQueryRedirector((QueryRedirector) PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.newInstanceFromClass(redirectorClass), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(defaultDeleteObjectQueryRedirectorClassName, ex)));
    }
    Iterator<DatabaseMapping> mappings = getMappings().iterator();
    while (mappings.hasNext()) {
        mappings.next().convertClassNamesToClasses(classLoader);
    }
    if (this.inheritancePolicy != null) {
        this.inheritancePolicy.convertClassNamesToClasses(classLoader);
    }
    if (this.interfacePolicy != null) {
        this.interfacePolicy.convertClassNamesToClasses(classLoader);
    }
    if (this.instantiationPolicy != null) {
        this.instantiationPolicy.convertClassNamesToClasses(classLoader);
    }
    if (hasCMPPolicy()) {
        getCMPPolicy().convertClassNamesToClasses(classLoader);
    }
    if (this.queryManager != null) {
        this.queryManager.convertClassNamesToClasses(classLoader);
    }
    if (this.cachePolicy != null) {
        this.cachePolicy.convertClassNamesToClasses(classLoader);
    }
    if (hasUnconvertedProperties()) {
        for (String propertyName : getUnconvertedProperties().keySet()) {
            List<String> valuePair = getUnconvertedProperties().get(propertyName);
            String value = valuePair.get(0);
            String valueTypeName = valuePair.get(1);
            Class<String> valueType = String.class;
            if (valueTypeName != null) {
                // Have to initialize the valueType now
                valueType = PrivilegedAccessHelper.callDoPrivilegedWithException(() -> org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(valueTypeName, true, classLoader), (ex) -> ValidationException.classNotFoundWhileConvertingClassNames(valueTypeName, ex));
            }
            // Add the converted property. If the value type is the same
            // as the source (value) type, no conversion is made.
            getProperties().put(propertyName, ConversionManager.getDefaultManager().convertObject(value, valueType));
        }
    }
}
Also used : CloneCopyPolicy(org.eclipse.persistence.descriptors.copying.CloneCopyPolicy) UnidirectionalOneToManyMapping(org.eclipse.persistence.mappings.UnidirectionalOneToManyMapping) Arrays(java.util.Arrays) DatabaseRecord(org.eclipse.persistence.sessions.DatabaseRecord) PartitioningPolicy(org.eclipse.persistence.descriptors.partitioning.PartitioningPolicy) DirectCollectionMapping(org.eclipse.persistence.mappings.DirectCollectionMapping) Enumeration(java.util.Enumeration) ProxyIndirectionPolicy(org.eclipse.persistence.internal.indirection.ProxyIndirectionPolicy) AttributeAccessor(org.eclipse.persistence.mappings.AttributeAccessor) DirectQueryKey(org.eclipse.persistence.mappings.querykeys.DirectQueryKey) DatabaseTable(org.eclipse.persistence.internal.helper.DatabaseTable) HistoryPolicy(org.eclipse.persistence.history.HistoryPolicy) DatabaseCall(org.eclipse.persistence.internal.databaseaccess.DatabaseCall) OneToOneMapping(org.eclipse.persistence.mappings.OneToOneMapping) Vector(java.util.Vector) DatabaseException(org.eclipse.persistence.exceptions.DatabaseException) Map(java.util.Map) DescriptorException(org.eclipse.persistence.exceptions.DescriptorException) Platform(org.eclipse.persistence.internal.databaseaccess.Platform) AbstractDirectMapping(org.eclipse.persistence.mappings.foundation.AbstractDirectMapping) Sequence(org.eclipse.persistence.sequencing.Sequence) VirtualAttributeMethodInfo(org.eclipse.persistence.internal.descriptors.VirtualAttributeMethodInfo) MappingCompare(org.eclipse.persistence.internal.helper.MappingCompare) CacheInvalidationPolicy(org.eclipse.persistence.descriptors.invalidation.CacheInvalidationPolicy) ValidationException(org.eclipse.persistence.exceptions.ValidationException) Method(java.lang.reflect.Method) DatabaseMapping(org.eclipse.persistence.mappings.DatabaseMapping) Association(org.eclipse.persistence.mappings.Association) ObjectLevelReadQuery(org.eclipse.persistence.queries.ObjectLevelReadQuery) CacheIsolationType(org.eclipse.persistence.config.CacheIsolationType) Project(org.eclipse.persistence.sessions.Project) SQLStatement(org.eclipse.persistence.internal.expressions.SQLStatement) Collection(java.util.Collection) SerializedObjectPolicyWrapper(org.eclipse.persistence.internal.descriptors.SerializedObjectPolicyWrapper) ChangeTracker(org.eclipse.persistence.descriptors.changetracking.ChangeTracker) Set(java.util.Set) ReadObjectQuery(org.eclipse.persistence.queries.ReadObjectQuery) IdValidation(org.eclipse.persistence.annotations.IdValidation) DynamicEntityImpl(org.eclipse.persistence.internal.dynamic.DynamicEntityImpl) CollectionMapping(org.eclipse.persistence.mappings.CollectionMapping) Serializable(java.io.Serializable) IdentityMap(org.eclipse.persistence.internal.identitymaps.IdentityMap) NonSynchronizedVector(org.eclipse.persistence.internal.helper.NonSynchronizedVector) List(java.util.List) ManyToOneMapping(org.eclipse.persistence.mappings.ManyToOneMapping) QueryKey(org.eclipse.persistence.mappings.querykeys.QueryKey) PersistenceEntityCopyPolicy(org.eclipse.persistence.descriptors.copying.PersistenceEntityCopyPolicy) OneToManyMapping(org.eclipse.persistence.mappings.OneToManyMapping) PersistenceObjectInstantiationPolicy(org.eclipse.persistence.internal.descriptors.PersistenceObjectInstantiationPolicy) CacheInterceptor(org.eclipse.persistence.sessions.interceptors.CacheInterceptor) PersistenceObject(org.eclipse.persistence.internal.descriptors.PersistenceObject) ForeignReferenceMapping(org.eclipse.persistence.mappings.ForeignReferenceMapping) CascadeLockingPolicy(org.eclipse.persistence.internal.descriptors.CascadeLockingPolicy) SQLSelectStatement(org.eclipse.persistence.internal.expressions.SQLSelectStatement) Helper(org.eclipse.persistence.internal.helper.Helper) PrivilegedAccessHelper(org.eclipse.persistence.internal.security.PrivilegedAccessHelper) ManyToManyMapping(org.eclipse.persistence.mappings.ManyToManyMapping) CopyPolicy(org.eclipse.persistence.descriptors.copying.CopyPolicy) HashMap(java.util.HashMap) DatabaseQuery(org.eclipse.persistence.queries.DatabaseQuery) CacheKeyType(org.eclipse.persistence.annotations.CacheKeyType) InsertObjectQuery(org.eclipse.persistence.queries.InsertObjectQuery) InstantiationPolicy(org.eclipse.persistence.internal.descriptors.InstantiationPolicy) ArrayList(java.util.ArrayList) AbstractSession(org.eclipse.persistence.internal.sessions.AbstractSession) HashSet(java.util.HashSet) DeferredChangeDetectionPolicy(org.eclipse.persistence.descriptors.changetracking.DeferredChangeDetectionPolicy) PersistenceWeavedChangeTracking(org.eclipse.persistence.internal.weaving.PersistenceWeavedChangeTracking) ObjectBuilder(org.eclipse.persistence.internal.descriptors.ObjectBuilder) AttributeGroup(org.eclipse.persistence.queries.AttributeGroup) ExpressionBuilder(org.eclipse.persistence.expressions.ExpressionBuilder) AggregateObjectMapping(org.eclipse.persistence.mappings.AggregateObjectMapping) DistributedSession(org.eclipse.persistence.sessions.remote.DistributedSession) Iterator(java.util.Iterator) OptimisticLockingPolicy(org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy) ClassConstants(org.eclipse.persistence.internal.helper.ClassConstants) AbstractRecord(org.eclipse.persistence.internal.sessions.AbstractRecord) CoreDescriptor(org.eclipse.persistence.core.descriptors.CoreDescriptor) NoExpiryCacheInvalidationPolicy(org.eclipse.persistence.descriptors.invalidation.NoExpiryCacheInvalidationPolicy) DatasourceCall(org.eclipse.persistence.internal.databaseaccess.DatasourceCall) QueryRedirector(org.eclipse.persistence.queries.QueryRedirector) FetchGroup(org.eclipse.persistence.queries.FetchGroup) Expression(org.eclipse.persistence.expressions.Expression) AggregateMapping(org.eclipse.persistence.mappings.AggregateMapping) DatabaseField(org.eclipse.persistence.internal.helper.DatabaseField) FetchGroupTracker(org.eclipse.persistence.queries.FetchGroupTracker) InstantiationCopyPolicy(org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy) PersistenceObjectAttributeAccessor(org.eclipse.persistence.internal.descriptors.PersistenceObjectAttributeAccessor) DirectToFieldMapping(org.eclipse.persistence.mappings.DirectToFieldMapping) AttributeChangeTrackingPolicy(org.eclipse.persistence.descriptors.changetracking.AttributeChangeTrackingPolicy) DeleteObjectQuery(org.eclipse.persistence.queries.DeleteObjectQuery) ConversionManager(org.eclipse.persistence.internal.helper.ConversionManager) AggregateCollectionMapping(org.eclipse.persistence.mappings.AggregateCollectionMapping) ObjectReferenceMapping(org.eclipse.persistence.mappings.ObjectReferenceMapping) ObjectChangePolicy(org.eclipse.persistence.descriptors.changetracking.ObjectChangePolicy) SerializedObjectPolicyWrapper(org.eclipse.persistence.internal.descriptors.SerializedObjectPolicyWrapper) DatabaseMapping(org.eclipse.persistence.mappings.DatabaseMapping) CloneCopyPolicy(org.eclipse.persistence.descriptors.copying.CloneCopyPolicy) PersistenceEntityCopyPolicy(org.eclipse.persistence.descriptors.copying.PersistenceEntityCopyPolicy) CopyPolicy(org.eclipse.persistence.descriptors.copying.CopyPolicy) InstantiationCopyPolicy(org.eclipse.persistence.descriptors.copying.InstantiationCopyPolicy)

Example 23 with Project

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

the class DataReadQueryContainerPolicyTest method setup.

@Override
protected void setup() throws IOException {
    m_exceptionCaught = false;
    Project project = XMLProjectReader.read("testDeployment.xml", getClass().getClassLoader());
    m_session = project.createDatabaseSession();
    m_session.setSessionLog(getSession().getSessionLog());
    m_session.setLogin(getSession().getLogin());
    m_session.login();
}
Also used : Project(org.eclipse.persistence.sessions.Project)

Example 24 with Project

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

the class TestModel method resetEntity.

/**
 * If setupEntity has been called then this must be called to reset the model again.
 */
@Override
public void resetEntity() {
    if (isSetup()) {
        setTests(getOriginalTests());
        setIsSetup(false);
    }
    if (this.getSummary().didSetupWarn()) {
        return;
    }
    reset();
    // To improve test consistency cleanup the session and executor better.
    getSession().getIdentityMapAccessor().initializeIdentityMaps();
    if (shouldResetSystemAfterEachTestModel()) {
        getExecutor().setConfiguredSystems(new Vector());
        // Logout and clean/reset the session in case test model failed ungracefully.
        if (getSession().isDatabaseSession()) {
            try {
                getDatabaseSession().logout();
            } catch (Exception ignore) {
            }
        }
        if (this.login == null) {
            this.login = getSession().getDatasourceLogin();
            this.sessionLog = getSession().getSessionLog();
        }
        // Check if login or log were corrupted.
        if (this.login.getClass() != getSession().getDatasourceLogin().getClass()) {
            System.out.println("Login changed by test model:" + this);
        }
        if (this.sessionLog.getLevel() != getSession().getSessionLog().getLevel()) {
            System.out.println("Log level changed by test model:" + this);
        }
        if (this.login instanceof DatabaseLogin) {
            DatabaseLogin login = (DatabaseLogin) this.login;
            if (login.shouldBindAllParameters() != getSession().getLogin().shouldBindAllParameters()) {
                System.out.println("Binding changed by test model:" + this);
            }
            if (login.shouldCacheAllStatements() != getSession().getLogin().shouldCacheAllStatements()) {
                System.out.println("Statement caching changed by test model:" + this);
            }
            if (login.shouldUseBatchWriting() != getSession().getLogin().shouldUseBatchWriting()) {
                System.out.println("Batch writing changed by test model:" + this);
            }
            if (login.shouldUseJDBCBatchWriting() != getSession().getLogin().shouldUseJDBCBatchWriting()) {
                System.out.println("JDBC batch writing changed by test model:" + this);
            }
            if (login.shouldUseNativeSQL() != getSession().getLogin().shouldUseNativeSQL()) {
                System.out.println("Native SQL changed by test model:" + this);
            }
            if (login.getTableQualifier() != getSession().getLogin().getTableQualifier()) {
                System.out.println("Table qualifier changed by test model:" + this);
            }
        }
        DatabaseSession session = new Project(this.login).createDatabaseSession();
        session.setSessionLog(this.sessionLog);
        getExecutor().setSession(session);
        // Check if default conversion manager was corrupted.
        if (!ConversionManager.getDefaultManager().shouldUseClassLoaderFromCurrentThread()) {
            System.out.println("ConversionManager corrupted by test model:" + this);
        }
        ConversionManager.setDefaultManager(null);
        getSession().getDatasourceLogin().getDatasourcePlatform().setConversionManager(null);
        SessionManager.getManager().setSessions(new ConcurrentHashMap<String, Session>());
        getDatabaseSession().login();
    }
    setIsSetup(false);
}
Also used : DatabaseLogin(org.eclipse.persistence.sessions.DatabaseLogin) Project(org.eclipse.persistence.sessions.Project) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) Session(org.eclipse.persistence.sessions.Session)

Example 25 with Project

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

the class ChoiceCollectionReuseTestCases method getNewProject.

@Override
public Project getNewProject(Project originalProject, ClassLoader classLoader) {
    Project project = super.getNewProject(originalProject, classLoader);
    project.getDatasourceLogin().setPlatform(new SAXPlatform());
    return project;
}
Also used : Project(org.eclipse.persistence.sessions.Project) SAXPlatform(org.eclipse.persistence.oxm.platform.SAXPlatform)

Aggregations

Project (org.eclipse.persistence.sessions.Project)216 StringReader (java.io.StringReader)92 ObjectPersistenceWorkbenchXMLProject (org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceWorkbenchXMLProject)83 Test (org.junit.Test)83 XMLContext (org.eclipse.persistence.oxm.XMLContext)80 NonJDBCTestHelper.buildTestProject (org.eclipse.persistence.testing.tests.nonJDBC.NonJDBCTestHelper.buildTestProject)60 NonJDBCTestHelper.buildWorkbenchXMLProject (org.eclipse.persistence.testing.tests.nonJDBC.NonJDBCTestHelper.buildWorkbenchXMLProject)60 Document (org.w3c.dom.Document)53 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)49 PLSQLStoredProcedureCall (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall)37 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)30 DatabaseLogin (org.eclipse.persistence.sessions.DatabaseLogin)28 XMLDescriptor (org.eclipse.persistence.oxm.XMLDescriptor)27 XMLLogin (org.eclipse.persistence.oxm.XMLLogin)25 SchemaModelProject (org.eclipse.persistence.internal.oxm.schema.SchemaModelProject)24 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)23 DataModifyQuery (org.eclipse.persistence.queries.DataModifyQuery)22 Schema (org.eclipse.persistence.internal.oxm.schema.model.Schema)17 Descriptor (org.eclipse.persistence.internal.oxm.mappings.Descriptor)16 XMLUnmarshaller (org.eclipse.persistence.oxm.XMLUnmarshaller)16