working on backend-side translations
This commit is contained in:
@@ -8,6 +8,7 @@ import static de.srsoftware.tools.jdbc.Query.Dialect.SQLITE;
|
||||
import static de.srsoftware.tools.jdbc.Query.SelectQuery.ALL;
|
||||
import static de.srsoftware.umbrella.company.Constants.*;
|
||||
import static de.srsoftware.umbrella.core.Constants.*;
|
||||
import static de.srsoftware.umbrella.core.Errors.*;
|
||||
import static de.srsoftware.umbrella.core.Field.*;
|
||||
import static de.srsoftware.umbrella.core.Field.COMPANY_ID;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.databaseException;
|
||||
@@ -65,8 +66,7 @@ CREATE TABLE IF NOT EXISTS "companies" (
|
||||
stmt.execute();
|
||||
stmt.close();
|
||||
} catch (SQLException e) {
|
||||
LOG.log(ERROR, ERROR_FAILED_CREATE_TABLE, TABLE_COMPANIES, e);
|
||||
throw new RuntimeException(e);
|
||||
throw databaseException(FAILED_TO_CREATE_TABLE,TABLE_COMPANIES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,8 +77,7 @@ CREATE TABLE IF NOT EXISTS "companies" (
|
||||
stmt.execute();
|
||||
stmt.close();
|
||||
} catch (SQLException e) {
|
||||
LOG.log(ERROR, ERROR_FAILED_CREATE_TABLE, TABLE_COMPANIES_USERS, e);
|
||||
throw new RuntimeException(e);
|
||||
throw databaseException(FAILED_TO_CREATE_TABLE,TABLE_COMPANIES);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +90,7 @@ CREATE TABLE IF NOT EXISTS "companies" (
|
||||
.execute(db)
|
||||
.close();
|
||||
} catch (SQLException e) {
|
||||
throw databaseException("Failed to assign user {0} to company {1}");
|
||||
throw databaseException(FAILED_TO_ASSIGN_USER_TO_COMPANY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +101,7 @@ CREATE TABLE IF NOT EXISTS "companies" (
|
||||
delete().from(TABLE_COMPANIES).where(ID,equal(companyId)).execute(db);
|
||||
return companyId;
|
||||
} catch (SQLException e) {
|
||||
throw databaseException("Failed to remove company {0}",companyId);
|
||||
throw databaseException(FAILED_TO_DROP_COMPANY,companyId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,7 +110,7 @@ CREATE TABLE IF NOT EXISTS "companies" (
|
||||
try {
|
||||
delete().from(TABLE_COMPANIES_USERS).where(COMPANY_ID,equal(companyId)).where(USER_ID,equal(userId)).execute(db);
|
||||
} catch (SQLException e) {
|
||||
throw databaseException("Failed to remove user {0} from company {1}",userId,companyId);
|
||||
throw databaseException(FAILED_TO_REMOVE_USER_FROM_COMPANY,userId,companyId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +123,7 @@ CREATE TABLE IF NOT EXISTS "companies" (
|
||||
rs.close();
|
||||
return ids;
|
||||
} catch (SQLException e) {
|
||||
throw databaseException("Failed to load members of company {0}",companyId);
|
||||
throw databaseException(FAILED_TO_LOAD_COMPANY_MEMBERS,companyId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user