1 package org.simantics.db.common.procedure.adapter;
3 import org.simantics.db.AsyncReadGraph;
4 import org.simantics.db.DirectStatements;
5 import org.simantics.db.exception.DatabaseException;
6 import org.simantics.db.procedure.AsyncProcedure;
8 public class DirectStatementProcedure implements AsyncProcedure<DirectStatements> {
10 DirectStatements result = null;
11 DatabaseException exception = null;
14 public void execute(AsyncReadGraph graph, final DirectStatements ds) {
19 public void exception(AsyncReadGraph graph, Throwable throwable) {
20 if(throwable instanceof DatabaseException) {
21 exception = (DatabaseException)throwable;
23 exception = new DatabaseException(throwable);
27 public DirectStatements getOrThrow() throws DatabaseException {
28 if(exception != null) throw exception;