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

com.infomaximum.platform.querypool.EditableResourceImpl 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 EditableResourceImpl extends ReadableResourceImpl implements EditableResource {

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

    @Override
    public T create(QueryTransaction transaction) throws PlatformException {
        try {
            return transaction.getDBTransaction().create(tClass);
        } catch (DatabaseException e) {
            throw GeneralExceptionBuilder.buildDatabaseException(e);
        }
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy