mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[jdbc] Fix null annotation warnings (#15426)
Signed-off-by: Jacob Laursen <jacob-github@vindvejr.dk>
This commit is contained in:
parent
c47e833ed9
commit
7ab04b20a1
@ -542,15 +542,15 @@ public class JdbcBaseDAO {
|
||||
|
||||
protected String resolveTimeFilter(FilterCriteria filter, ZoneId timeZone) {
|
||||
String filterString = "";
|
||||
if (filter.getBeginDate() != null) {
|
||||
ZonedDateTime beginDate = filter.getBeginDate();
|
||||
if (beginDate != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(beginDate.withZoneSameInstant(timeZone)) + "'";
|
||||
}
|
||||
if (filter.getEndDate() != null) {
|
||||
ZonedDateTime endDate = filter.getEndDate();
|
||||
if (endDate != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(endDate.withZoneSameInstant(timeZone)) + "'";
|
||||
}
|
||||
return filterString;
|
||||
}
|
||||
|
@ -242,15 +242,15 @@ public class JdbcDerbyDAO extends JdbcBaseDAO {
|
||||
StringUtilsExt.filterToString(filter), numberDecimalcount, table, simpleName);
|
||||
|
||||
String filterString = "";
|
||||
if (filter.getBeginDate() != null) {
|
||||
ZonedDateTime beginDate = filter.getBeginDate();
|
||||
if (beginDate != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(beginDate.withZoneSameInstant(timeZone)) + "'";
|
||||
}
|
||||
if (filter.getEndDate() != null) {
|
||||
ZonedDateTime endDate = filter.getEndDate();
|
||||
if (endDate != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(endDate.withZoneSameInstant(timeZone)) + "'";
|
||||
}
|
||||
filterString += (filter.getOrdering() == Ordering.ASCENDING) ? " ORDER BY time ASC" : " ORDER BY time DESC";
|
||||
if (filter.getPageSize() != 0x7fffffff) {
|
||||
|
@ -260,15 +260,15 @@ public class JdbcPostgresqlDAO extends JdbcBaseDAO {
|
||||
filter.toString(), numberDecimalcount, table, simpleName);
|
||||
|
||||
String filterString = "";
|
||||
if (filter.getBeginDate() != null) {
|
||||
ZonedDateTime beginDate = filter.getBeginDate();
|
||||
if (beginDate != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(filter.getBeginDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
filterString += " TIME>='" + JDBC_DATE_FORMAT.format(beginDate.withZoneSameInstant(timeZone)) + "'";
|
||||
}
|
||||
if (filter.getEndDate() != null) {
|
||||
ZonedDateTime endDate = filter.getEndDate();
|
||||
if (endDate != null) {
|
||||
filterString += filterString.isEmpty() ? " WHERE" : " AND";
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(filter.getEndDate().withZoneSameInstant(timeZone))
|
||||
+ "'";
|
||||
filterString += " TIME<='" + JDBC_DATE_FORMAT.format(endDate.withZoneSameInstant(timeZone)) + "'";
|
||||
}
|
||||
filterString += (filter.getOrdering() == Ordering.ASCENDING) ? " ORDER BY time ASC" : " ORDER BY time DESC";
|
||||
if (filter.getPageSize() != 0x7fffffff) {
|
||||
|
Loading…
Reference in New Issue
Block a user