Search in sources :

Example 1 with UpdateQueryEngineDatabaseAction

use of org.bimserver.database.actions.UpdateQueryEngineDatabaseAction in project BIMserver by opensourceBIM.

the class PluginServiceImpl method updateQueryEngine.

@Override
public void updateQueryEngine(SQueryEnginePluginConfiguration queryEngine) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        QueryEnginePluginConfiguration convert = session.get(queryEngine.getOid(), OldQuery.getDefault());
        getBimServer().getSConverter().convertFromSObject(queryEngine, convert, session);
        session.executeAndCommitAction(new UpdateQueryEngineDatabaseAction(session, getInternalAccessMethod(), convert));
    } catch (Exception e) {
        handleException(e);
    } finally {
        session.close();
    }
}
Also used : SQueryEnginePluginConfiguration(org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration) QueryEnginePluginConfiguration(org.bimserver.models.store.QueryEnginePluginConfiguration) DatabaseSession(org.bimserver.database.DatabaseSession) UpdateQueryEngineDatabaseAction(org.bimserver.database.actions.UpdateQueryEngineDatabaseAction) IOException(java.io.IOException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException) UserException(org.bimserver.shared.exceptions.UserException)

Aggregations

IOException (java.io.IOException)1 BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 UpdateQueryEngineDatabaseAction (org.bimserver.database.actions.UpdateQueryEngineDatabaseAction)1 SQueryEnginePluginConfiguration (org.bimserver.interfaces.objects.SQueryEnginePluginConfiguration)1 QueryEnginePluginConfiguration (org.bimserver.models.store.QueryEnginePluginConfiguration)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1