Search in sources :

Example 1 with IntegrityChecker

use of org.eclipse.persistence.exceptions.IntegrityChecker in project eclipselink by eclipse-ee4j.

the class BidirectionWithHashtableTest method test.

@Override
public void test() {
    try {
        getSession().setIntegrityChecker(new IntegrityChecker());
        getSession().getIntegrityChecker().dontCatchExceptions();
        ((DatabaseSession) getSession()).addDescriptor(descriptor());
    } catch (EclipseLinkException exception) {
        caughtException = exception;
    }
}
Also used : IntegrityChecker(org.eclipse.persistence.exceptions.IntegrityChecker) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) EclipseLinkException(org.eclipse.persistence.exceptions.EclipseLinkException)

Example 2 with IntegrityChecker

use of org.eclipse.persistence.exceptions.IntegrityChecker in project eclipselink by eclipse-ee4j.

the class ForeignKeysDefinedIncorrectlyTest method test.

@Override
public void test() {
    try {
        getSession().setIntegrityChecker(new IntegrityChecker());
        getSession().getIntegrityChecker().dontCatchExceptions();
        ((DatabaseSession) getSession()).addDescriptor(descriptor());
    } catch (EclipseLinkException exception) {
        caughtException = exception;
    }
}
Also used : IntegrityChecker(org.eclipse.persistence.exceptions.IntegrityChecker) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) EclipseLinkException(org.eclipse.persistence.exceptions.EclipseLinkException)

Example 3 with IntegrityChecker

use of org.eclipse.persistence.exceptions.IntegrityChecker in project eclipselink by eclipse-ee4j.

the class GetMethodReturnTypeNotValidTest method setup.

@Override
protected void setup() {
    expectedException = DescriptorException.getMethodReturnTypeNotValid(new OneToManyMapping());
    orgIntegrityChecker = getSession().getIntegrityChecker();
    getSession().setIntegrityChecker(new IntegrityChecker());
    getSession().getIntegrityChecker().dontCatchExceptions();
}
Also used : IntegrityChecker(org.eclipse.persistence.exceptions.IntegrityChecker) OneToManyMapping(org.eclipse.persistence.mappings.OneToManyMapping)

Example 4 with IntegrityChecker

use of org.eclipse.persistence.exceptions.IntegrityChecker in project eclipselink by eclipse-ee4j.

the class GetMethodReturnsValueHolderTest method test.

@Override
public void test() {
    try {
        getSession().setIntegrityChecker(new IntegrityChecker());
        getSession().getIntegrityChecker().dontCatchExceptions();
        ((DatabaseSession) getSession()).addDescriptor(descriptor());
    } catch (EclipseLinkException exception) {
        caughtException = exception;
    }
}
Also used : IntegrityChecker(org.eclipse.persistence.exceptions.IntegrityChecker) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) EclipseLinkException(org.eclipse.persistence.exceptions.EclipseLinkException)

Example 5 with IntegrityChecker

use of org.eclipse.persistence.exceptions.IntegrityChecker in project eclipselink by eclipse-ee4j.

the class IllegalArgumentWhileGettingValueThruInstanceVariableAccessorTest method test.

@Override
public void test() {
    org.eclipse.persistence.testing.tests.validation.PersonInstanceAccess person = new org.eclipse.persistence.testing.tests.validation.PersonInstanceAccess();
    person.setName("Person");
    Address address = new Address();
    try {
        getSession().setIntegrityChecker(new IntegrityChecker());
        getSession().getIntegrityChecker().dontCatchExceptions();
        ((DatabaseSession) getSession()).addDescriptor(descriptor());
        UnitOfWork uow = getSession().acquireUnitOfWork();
        uow.registerObject(person);
        uow.commit();
        DatabaseMapping dMapping = descriptor().getMappingForAttributeName("p_name");
        DatabaseMapping idMapping = descriptor().getMappingForAttributeName("p_id");
        dMapping.getAttributeAccessor().initializeAttributes(org.eclipse.persistence.testing.tests.validation.PersonInstanceAccess.class);
        dMapping.getAttributeAccessor().initializeAttributes(org.eclipse.persistence.testing.tests.validation.PersonInstanceAccess.class);
        dMapping.getAttributeValueFromObject(address);
    } catch (EclipseLinkException exception) {
        caughtException = exception;
    }
}
Also used : IntegrityChecker(org.eclipse.persistence.exceptions.IntegrityChecker) UnitOfWork(org.eclipse.persistence.sessions.UnitOfWork) DatabaseSession(org.eclipse.persistence.sessions.DatabaseSession) DatabaseMapping(org.eclipse.persistence.mappings.DatabaseMapping) EclipseLinkException(org.eclipse.persistence.exceptions.EclipseLinkException)

Aggregations

IntegrityChecker (org.eclipse.persistence.exceptions.IntegrityChecker)75 EclipseLinkException (org.eclipse.persistence.exceptions.EclipseLinkException)44 DatabaseSession (org.eclipse.persistence.sessions.DatabaseSession)36 RelationalDescriptor (org.eclipse.persistence.descriptors.RelationalDescriptor)12 DescriptorException (org.eclipse.persistence.exceptions.DescriptorException)4 DatabaseMapping (org.eclipse.persistence.mappings.DatabaseMapping)4 UnitOfWork (org.eclipse.persistence.sessions.UnitOfWork)4 Vector (java.util.Vector)3 TransparentIndirectionPolicy (org.eclipse.persistence.internal.indirection.TransparentIndirectionPolicy)3 DirectToFieldMapping (org.eclipse.persistence.mappings.DirectToFieldMapping)3 OneToManyMapping (org.eclipse.persistence.mappings.OneToManyMapping)3 Employee (org.eclipse.persistence.testing.models.employee.domain.Employee)3 ClassDescriptor (org.eclipse.persistence.descriptors.ClassDescriptor)2 VersionLockingPolicy (org.eclipse.persistence.descriptors.VersionLockingPolicy)2 CloneCopyPolicy (org.eclipse.persistence.descriptors.copying.CloneCopyPolicy)2 OneToOneMapping (org.eclipse.persistence.mappings.OneToOneMapping)2 HashMap (java.util.HashMap)1 Hashtable (java.util.Hashtable)1 IntegrityException (org.eclipse.persistence.exceptions.IntegrityException)1 MethodAttributeAccessor (org.eclipse.persistence.internal.descriptors.MethodAttributeAccessor)1