Search in sources :

Example 1 with DeleteObjectIDMDatabaseAction

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

the class PluginServiceImpl method deleteObjectIDM.

@Override
public void deleteObjectIDM(Long ifid) throws ServerException, UserException {
    requireRealUserAuthentication();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        BimDatabaseAction<Void> action = new DeleteObjectIDMDatabaseAction(session, getInternalAccessMethod(), ifid);
        session.executeAndCommitAction(action);
    } catch (Exception e) {
        handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) DeleteObjectIDMDatabaseAction(org.bimserver.database.actions.DeleteObjectIDMDatabaseAction) 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 DeleteObjectIDMDatabaseAction (org.bimserver.database.actions.DeleteObjectIDMDatabaseAction)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1