working on project list: introducing task list

This commit is contained in:
2025-07-19 21:05:17 +02:00
parent 8e3fa266a8
commit a14b541c91
16 changed files with 128 additions and 40 deletions

View File

@@ -2,6 +2,7 @@
package de.srsoftware.umbrella.company;
import static de.srsoftware.tools.jdbc.Condition.equal;
import static de.srsoftware.tools.jdbc.Query.SelectQuery.ALL;
import static de.srsoftware.tools.jdbc.Query.select;
import static de.srsoftware.umbrella.company.Constants.TABLE_COMPANIES;
import static de.srsoftware.umbrella.company.Constants.TABLE_COMPANIES_USERS;
@@ -29,7 +30,7 @@ public class SqliteDb implements CompanyDb {
@Override
public Collection<Long> getMembers(long companyId) throws UmbrellaException {
try {
var rs = select("*").from(TABLE_COMPANIES_USERS).where(COMPANY_ID, equal(companyId)).exec(db);
var rs = select(ALL).from(TABLE_COMPANIES_USERS).where(COMPANY_ID, equal(companyId)).exec(db);
var ids = new HashSet<Long>();
while (rs.next()) ids.add(rs.getLong(USER_ID));
rs.close();
@@ -42,7 +43,7 @@ public class SqliteDb implements CompanyDb {
@Override
public Map<Long,Company> listCompaniesOf(long userId) throws UmbrellaException {
try {
var rs = select("*").from(TABLE_COMPANIES).leftJoin(ID,TABLE_COMPANIES_USERS,COMPANY_ID).where(USER_ID,equal(userId)).exec(db);
var rs = select(ALL).from(TABLE_COMPANIES).leftJoin(ID,TABLE_COMPANIES_USERS,COMPANY_ID).where(USER_ID,equal(userId)).exec(db);
var companies = new HashMap<Long,Company>();
while (rs.next()) {
var company = Company.of(rs);
@@ -58,7 +59,7 @@ public class SqliteDb implements CompanyDb {
@Override
public Company load(long companyId) throws UmbrellaException {
try {
var rs = select("*").from(TABLE_COMPANIES).where(ID, equal(companyId)).exec(db);
var rs = select(ALL).from(TABLE_COMPANIES).where(ID, equal(companyId)).exec(db);
Company company = null;
if (rs.next()) company = Company.of(rs);
rs.close();