Search in sources :

Example 1 with CountDatabaseAction

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

the class LowLevelServiceImpl method count.

public Integer count(Long roid, String className) throws UserException, ServerException {
    requireAuthenticationAndRunningServer();
    DatabaseSession session = getBimServer().getDatabase().createSession();
    try {
        CountDatabaseAction action = new CountDatabaseAction(getBimServer(), session, getInternalAccessMethod(), roid, className, getAuthorization());
        return session.executeAndCommitAction(action);
    } catch (Exception e) {
        return handleException(e);
    } finally {
        session.close();
    }
}
Also used : DatabaseSession(org.bimserver.database.DatabaseSession) CountDatabaseAction(org.bimserver.database.actions.CountDatabaseAction) UserException(org.bimserver.shared.exceptions.UserException) NoTransactionException(org.bimserver.webservices.NoTransactionException) ServerException(org.bimserver.shared.exceptions.ServerException) BimserverDatabaseException(org.bimserver.BimserverDatabaseException)

Aggregations

BimserverDatabaseException (org.bimserver.BimserverDatabaseException)1 DatabaseSession (org.bimserver.database.DatabaseSession)1 CountDatabaseAction (org.bimserver.database.actions.CountDatabaseAction)1 ServerException (org.bimserver.shared.exceptions.ServerException)1 UserException (org.bimserver.shared.exceptions.UserException)1 NoTransactionException (org.bimserver.webservices.NoTransactionException)1