|
|
|
@ -10,6 +10,7 @@ import static de.srsoftware.umbrella.time.Constants.*; |
|
|
|
import static java.lang.System.Logger.Level.ERROR; |
|
|
|
import static java.lang.System.Logger.Level.ERROR; |
|
|
|
import static java.text.MessageFormat.format; |
|
|
|
import static java.text.MessageFormat.format; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import de.srsoftware.tools.jdbc.Query; |
|
|
|
import de.srsoftware.umbrella.core.BaseDb; |
|
|
|
import de.srsoftware.umbrella.core.BaseDb; |
|
|
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException; |
|
|
|
import de.srsoftware.umbrella.core.exceptions.UmbrellaException; |
|
|
|
import de.srsoftware.umbrella.core.model.Time; |
|
|
|
import de.srsoftware.umbrella.core.model.Time; |
|
|
|
@ -77,6 +78,19 @@ CREATE TABLE IF NOT EXISTS {0} ( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Long delete(long timeId) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
db.setAutoCommit(false); |
|
|
|
|
|
|
|
Query.delete().from(TABLE_TASK_TIMES).where(TIME_ID,equal(timeId)).execute(db); |
|
|
|
|
|
|
|
Query.delete().from(TABLE_TIMES).where(ID,equal(timeId)).execute(db); |
|
|
|
|
|
|
|
db.setAutoCommit(false); |
|
|
|
|
|
|
|
return timeId; |
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
|
|
|
|
throw UmbrellaException.databaseException("Failed to delete time with id = {0}",timeId); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public HashMap<Long,Time> listTimes(Collection<Long> taskIds, boolean showClosed) throws UmbrellaException { |
|
|
|
public HashMap<Long,Time> listTimes(Collection<Long> taskIds, boolean showClosed) throws UmbrellaException { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|