All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.infomaximum.platform.querypool.RemovableResourceImpl Maven / Gradle / Ivy

There is a newer version: 0.1.15p24
Show newest version
package com.infomaximum.platform.querypool;

import com.infomaximum.database.domainobject.DomainObject;
import com.infomaximum.database.domainobject.DomainObjectEditable;
import com.infomaximum.database.exception.DatabaseException;
import com.infomaximum.platform.exception.PlatformException;
import com.infomaximum.platform.sdk.exception.GeneralExceptionBuilder;

class RemovableResourceImpl extends EditableResourceImpl implements RemovableResource {

	RemovableResourceImpl(Class tClass) {
        super(tClass);
    }

    @Override
    public void remove(T obj, QueryTransaction transaction) throws PlatformException {
        try {
            transaction.getDBTransaction().remove(obj);
        } catch (DatabaseException e) {
            throw GeneralExceptionBuilder.buildDatabaseException(e);
        }
    }

    @Override
    public void clear(QueryTransaction transaction) throws PlatformException {
        try {
            transaction.getDBTransaction().removeAll(getDomainClass());
        } catch (DatabaseException e) {
            throw GeneralExceptionBuilder.buildDatabaseException(e);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy