| sqltype.CONTACT | `VARCHAR(6)` | No | see above |
| sqltype.DATETIME | `DATETIME` | No | see above |
| sqltype.DIMMER | `TINYINT` | No | see above |
-| sqltype.LOCATION | `VARCHAR(30)` | No | see above |
+| sqltype.IMAGE | `VARCHAR(65500)` | No | see above |
+| sqltype.LOCATION | `VARCHAR(50)` | No | see above |
| sqltype.NUMBER | `DOUBLE` | No | see above |
+| sqltype.PLAYER | `VARCHAR(20)` | No | see above |
| sqltype.ROLLERSHUTTER | `TINYINT` | No | see above |
| sqltype.STRING | `VARCHAR(65500)` | No | see above |
| sqltype.SWITCH | `VARCHAR(6)` | No | see above |
import org.openhab.core.persistence.HistoricItem;
import org.openhab.core.types.State;
import org.openhab.core.types.TypeParser;
-import org.openhab.persistence.jdbc.model.ItemVO;
-import org.openhab.persistence.jdbc.model.ItemsVO;
-import org.openhab.persistence.jdbc.model.JdbcHistoricItem;
+import org.openhab.persistence.jdbc.dto.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemsVO;
+import org.openhab.persistence.jdbc.dto.JdbcHistoricItem;
import org.openhab.persistence.jdbc.utils.DbMetaData;
import org.openhab.persistence.jdbc.utils.StringUtilsExt;
import org.slf4j.Logger;
sqlTypes.put("DATETIMEITEM", "TIMESTAMP");
sqlTypes.put("DIMMERITEM", "TINYINT");
sqlTypes.put("IMAGEITEM", "VARCHAR(65500)");// jdbc max 21845
- sqlTypes.put("LOCATIONITEM", "VARCHAR(30)");
+ sqlTypes.put("LOCATIONITEM", "VARCHAR(50)");
sqlTypes.put("NUMBERITEM", "DOUBLE");
sqlTypes.put("PLAYERITEM", "VARCHAR(20)");
sqlTypes.put("ROLLERSHUTTERITEM", "TINYINT");
import org.openhab.core.persistence.FilterCriteria;
import org.openhab.core.persistence.FilterCriteria.Ordering;
import org.openhab.core.persistence.HistoricItem;
-import org.openhab.persistence.jdbc.model.ItemVO;
-import org.openhab.persistence.jdbc.model.ItemsVO;
-import org.openhab.persistence.jdbc.model.JdbcHistoricItem;
+import org.openhab.persistence.jdbc.dto.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemsVO;
+import org.openhab.persistence.jdbc.dto.JdbcHistoricItem;
import org.openhab.persistence.jdbc.utils.StringUtilsExt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.knowm.yank.Yank;
import org.openhab.core.items.Item;
-import org.openhab.persistence.jdbc.model.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemVO;
import org.openhab.persistence.jdbc.utils.StringUtilsExt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.knowm.yank.Yank;
import org.openhab.core.items.Item;
-import org.openhab.persistence.jdbc.model.ItemVO;
-import org.openhab.persistence.jdbc.model.ItemsVO;
+import org.openhab.persistence.jdbc.dto.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemsVO;
import org.openhab.persistence.jdbc.utils.StringUtilsExt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.openhab.core.items.Item;
import org.openhab.core.persistence.FilterCriteria;
import org.openhab.core.persistence.FilterCriteria.Ordering;
-import org.openhab.persistence.jdbc.model.ItemVO;
-import org.openhab.persistence.jdbc.model.ItemsVO;
+import org.openhab.persistence.jdbc.dto.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemsVO;
import org.openhab.persistence.jdbc.utils.StringUtilsExt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.knowm.yank.Yank;
import org.openhab.core.items.Item;
-import org.openhab.persistence.jdbc.model.ItemVO;
-import org.openhab.persistence.jdbc.model.ItemsVO;
+import org.openhab.persistence.jdbc.dto.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemsVO;
import org.openhab.persistence.jdbc.utils.StringUtilsExt;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
--- /dev/null
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.persistence.jdbc.dto;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Represents the Item-data on the part of MyBatis/database.
+ *
+ * @author Helmut Lehmeyer - Initial contribution
+ */
+public class ItemVO implements Serializable {
+ private final Logger logger = LoggerFactory.getLogger(ItemVO.class);
+
+ private static final long serialVersionUID = 1871441039821454890L;
+
+ private String tableName;
+ private String newTableName;
+ private String dbType;
+ private String jdbcType;
+ private String itemType;
+ private Class<?> javaType;
+ private Date time;
+ private Object value;
+
+ public ItemVO(String tableName, String newTableName) {
+ logger.debug("JDBC:ItemVO tableName={}; newTableName={}; ", tableName, newTableName);
+ this.tableName = tableName;
+ this.newTableName = newTableName;
+ }
+
+ public ItemVO() {
+ }
+
+ public void setValueTypes(String dbType, Class<?> javaType) {
+ logger.debug("JDBC:ItemVO setValueTypes dbType={}; javaType={};", dbType, javaType);
+ this.dbType = dbType;
+ this.javaType = javaType;
+ }
+
+ public String getTableName() {
+ return tableName;
+ }
+
+ public void setTableName(String tableName) {
+ this.tableName = tableName;
+ }
+
+ public String getNewTableName() {
+ return newTableName;
+ }
+
+ public void setNewTableName(String newTableName) {
+ this.newTableName = newTableName;
+ }
+
+ public String getDbType() {
+ return dbType;
+ }
+
+ public void setDbType(String dbType) {
+ this.dbType = dbType;
+ }
+
+ public String getJdbcType() {
+ return jdbcType;
+ }
+
+ public void setJdbcType(String jdbcType) {
+ this.jdbcType = jdbcType;
+ }
+
+ public String getItemType() {
+ return itemType;
+ }
+
+ public void setItemType(String itemType) {
+ this.itemType = itemType;
+ }
+
+ public String getJavaType() {
+ return javaType.getName();
+ }
+
+ public void setJavaType(Class<?> javaType) {
+ this.javaType = javaType;
+ }
+
+ public Date getTime() {
+ return time;
+ }
+
+ public void setTime(Date time) {
+ this.time = time;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ /**
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ItemVO other = (ItemVO) obj;
+ if (value == null) {
+ if (other.value != null) {
+ return false;
+ }
+ } else if (!value.equals(other.value)) {
+ return false;
+ }
+ return time == other.time;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("ItemVO [tableName=");
+ builder.append(tableName);
+ builder.append(", newTableName=");
+ builder.append(newTableName);
+ builder.append(", dbType=");
+ builder.append(dbType);
+ builder.append(", javaType=");
+ builder.append(javaType);
+ builder.append(", time=");
+ builder.append(time);
+ builder.append(", value=");
+ builder.append(value);
+ builder.append("]");
+ return builder.toString();
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.persistence.jdbc.dto;
+
+import java.io.Serializable;
+
+/**
+ * Represents the table naming data.
+ *
+ * @author Helmut Lehmeyer - Initial contribution
+ */
+public class ItemsVO implements Serializable {
+
+ private static final long serialVersionUID = 2871961811177601520L;
+
+ private static final String STR_FILTER = "[^a-zA-Z0-9]";
+
+ private String coltype = "VARCHAR(500)";
+ private String colname = "itemname";
+ private String itemsManageTable = "items";
+ private int itemid;
+ private String itemname;
+ private String table_name;
+ private String jdbcUriDatabaseName;
+
+ public String getColtype() {
+ return coltype;
+ }
+
+ public void setColtype(String coltype) {
+ this.coltype = coltype.replaceAll(STR_FILTER, "");
+ }
+
+ public String getColname() {
+ return colname;
+ }
+
+ public void setColname(String colname) {
+ this.colname = colname.replaceAll(STR_FILTER, "");
+ }
+
+ public String getItemsManageTable() {
+ return itemsManageTable;
+ }
+
+ public void setItemsManageTable(String itemsManageTable) {
+ this.itemsManageTable = itemsManageTable.replaceAll(STR_FILTER, "");
+ }
+
+ public int getItemid() {
+ return itemid;
+ }
+
+ public void setItemid(int itemid) {
+ this.itemid = itemid;
+ }
+
+ public String getItemname() {
+ return itemname;
+ }
+
+ public void setItemname(String itemname) {
+ this.itemname = itemname;
+ }
+
+ public String getTable_name() {
+ return table_name;
+ }
+
+ public void setTable_name(String table_name) {
+ this.table_name = table_name;
+ }
+
+ public String getJdbcUriDatabaseName() {
+ return jdbcUriDatabaseName;
+ }
+
+ public void setJdbcUriDatabaseName(String jdbcUriDatabaseName) {
+ this.jdbcUriDatabaseName = jdbcUriDatabaseName;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((itemname == null) ? 0 : itemname.hashCode());
+ result = prime * result + (itemid ^ (itemid >>> 32));
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ ItemsVO other = (ItemsVO) obj;
+ if (itemname == null) {
+ if (other.itemname != null) {
+ return false;
+ }
+ } else if (!itemname.equals(other.itemname)) {
+ return false;
+ }
+ return itemid == other.itemid;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("ItemsVO [coltype=");
+ builder.append(coltype);
+ builder.append(", colname=");
+ builder.append(colname);
+ builder.append(", itemsManageTable=");
+ builder.append(itemsManageTable);
+ builder.append(", itemid=");
+ builder.append(itemid);
+ builder.append(", itemname=");
+ builder.append(itemname);
+ builder.append(", table_name=");
+ builder.append(table_name);
+ builder.append("]");
+ return builder.toString();
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.persistence.jdbc.dto;
+
+import java.time.ZonedDateTime;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.openhab.core.persistence.HistoricItem;
+import org.openhab.core.types.State;
+
+/**
+ * Represents the data on the part of openHAB.
+ *
+ * @author Helmut Lehmeyer - Initial contribution
+ */
+@NonNullByDefault
+public class JdbcHistoricItem implements HistoricItem {
+
+ private final String name;
+ private final State state;
+ private final ZonedDateTime timestamp;
+
+ public JdbcHistoricItem(String name, State state, ZonedDateTime timestamp) {
+ this.name = name;
+ this.state = state;
+ this.timestamp = timestamp;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public State getState() {
+ return state;
+ }
+
+ @Override
+ public ZonedDateTime getTimestamp() {
+ return timestamp;
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder builder = new StringBuilder();
+ builder.append("JdbcItem [name=");
+ builder.append(name);
+ builder.append(", state=");
+ builder.append(state);
+ builder.append(", timestamp=");
+ builder.append(timestamp);
+ builder.append("]");
+ return builder.toString();
+ }
+}
--- /dev/null
+/**
+ * Copyright (c) 2010-2021 Contributors to the openHAB project
+ *
+ * See the NOTICE file(s) distributed with this work for additional
+ * information.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ */
+package org.openhab.persistence.jdbc.dto;
+
+import java.util.Date;
+
+import org.eclipse.jdt.annotation.NonNullByDefault;
+import org.eclipse.jdt.annotation.Nullable;
+import org.openhab.core.persistence.PersistenceItemInfo;
+
+/**
+ * Represents the item info for openHAB.
+ *
+ * @author Christoph Weitkamp - Initial contribution
+ */
+@NonNullByDefault
+public class JdbcPersistenceItemInfo implements PersistenceItemInfo {
+
+ private final String name;
+ private final @Nullable Integer count;
+ private final @Nullable Date earliest;
+ private final @Nullable Date latest;
+
+ public JdbcPersistenceItemInfo(String name) {
+ this(name, null, null, null);
+ }
+
+ public JdbcPersistenceItemInfo(String name, @Nullable Integer count, @Nullable Date earliest,
+ @Nullable Date latest) {
+ this.name = name;
+ this.count = count;
+ this.earliest = earliest;
+ this.latest = latest;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public @Nullable Integer getCount() {
+ return count;
+ }
+
+ @Override
+ public @Nullable Date getEarliest() {
+ return earliest;
+ }
+
+ @Override
+ public @Nullable Date getLatest() {
+ return latest;
+ }
+}
import org.openhab.core.persistence.FilterCriteria;
import org.openhab.core.persistence.HistoricItem;
import org.openhab.core.persistence.PersistenceItemInfo;
-import org.openhab.persistence.jdbc.model.ItemVO;
-import org.openhab.persistence.jdbc.model.ItemsVO;
-import org.openhab.persistence.jdbc.model.JdbcPersistenceItemInfo;
+import org.openhab.persistence.jdbc.dto.ItemVO;
+import org.openhab.persistence.jdbc.dto.ItemsVO;
+import org.openhab.persistence.jdbc.dto.JdbcPersistenceItemInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+++ /dev/null
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.persistence.jdbc.model;
-
-import java.io.Serializable;
-import java.util.Date;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Represents the Item-data on the part of MyBatis/database.
- *
- * @author Helmut Lehmeyer - Initial contribution
- */
-public class ItemVO implements Serializable {
- private final Logger logger = LoggerFactory.getLogger(ItemVO.class);
-
- private static final long serialVersionUID = 1871441039821454890L;
-
- private String tableName;
- private String newTableName;
- private String dbType;
- private String jdbcType;
- private String itemType;
- private Class<?> javaType;
- private Date time;
- private Object value;
-
- public ItemVO(String tableName, String newTableName) {
- logger.debug("JDBC:ItemVO tableName={}; newTableName={}; ", tableName, newTableName);
- this.tableName = tableName;
- this.newTableName = newTableName;
- }
-
- public ItemVO() {
- }
-
- public void setValueTypes(String dbType, Class<?> javaType) {
- logger.debug("JDBC:ItemVO setValueTypes dbType={}; javaType={};", dbType, javaType);
- this.dbType = dbType;
- this.javaType = javaType;
- }
-
- public String getTableName() {
- return tableName;
- }
-
- public void setTableName(String tableName) {
- this.tableName = tableName;
- }
-
- public String getNewTableName() {
- return newTableName;
- }
-
- public void setNewTableName(String newTableName) {
- this.newTableName = newTableName;
- }
-
- public String getDbType() {
- return dbType;
- }
-
- public void setDbType(String dbType) {
- this.dbType = dbType;
- }
-
- public String getJdbcType() {
- return jdbcType;
- }
-
- public void setJdbcType(String jdbcType) {
- this.jdbcType = jdbcType;
- }
-
- public String getItemType() {
- return itemType;
- }
-
- public void setItemType(String itemType) {
- this.itemType = itemType;
- }
-
- public String getJavaType() {
- return javaType.getName();
- }
-
- public void setJavaType(Class<?> javaType) {
- this.javaType = javaType;
- }
-
- public Date getTime() {
- return time;
- }
-
- public void setTime(Date time) {
- this.time = time;
- }
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-
- /**
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ItemVO other = (ItemVO) obj;
- if (value == null) {
- if (other.value != null) {
- return false;
- }
- } else if (!value.equals(other.value)) {
- return false;
- }
- if (time != other.time) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("ItemVO [tableName=");
- builder.append(tableName);
- builder.append(", newTableName=");
- builder.append(newTableName);
- builder.append(", dbType=");
- builder.append(dbType);
- builder.append(", javaType=");
- builder.append(javaType);
- builder.append(", time=");
- builder.append(time);
- builder.append(", value=");
- builder.append(value);
- builder.append("]");
- return builder.toString();
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.persistence.jdbc.model;
-
-import java.io.Serializable;
-
-/**
- * Represents the table naming data.
- *
- * @author Helmut Lehmeyer - Initial contribution
- */
-public class ItemsVO implements Serializable {
-
- private static final long serialVersionUID = 2871961811177601520L;
-
- private static final String STR_FILTER = "[^a-zA-Z0-9]";
-
- private String coltype = "VARCHAR(500)";
- private String colname = "itemname";
- private String itemsManageTable = "items";
- private int itemid;
- private String itemname;
- private String table_name;
- private String jdbcUriDatabaseName;
-
- public String getColtype() {
- return coltype;
- }
-
- public void setColtype(String coltype) {
- this.coltype = coltype.replaceAll(STR_FILTER, "");
- }
-
- public String getColname() {
- return colname;
- }
-
- public void setColname(String colname) {
- this.colname = colname.replaceAll(STR_FILTER, "");
- }
-
- public String getItemsManageTable() {
- return itemsManageTable;
- }
-
- public void setItemsManageTable(String itemsManageTable) {
- this.itemsManageTable = itemsManageTable.replaceAll(STR_FILTER, "");
- }
-
- public int getItemid() {
- return itemid;
- }
-
- public void setItemid(int itemid) {
- this.itemid = itemid;
- }
-
- public String getItemname() {
- return itemname;
- }
-
- public void setItemname(String itemname) {
- this.itemname = itemname;
- }
-
- public String getTable_name() {
- return table_name;
- }
-
- public void setTable_name(String table_name) {
- this.table_name = table_name;
- }
-
- public String getJdbcUriDatabaseName() {
- return jdbcUriDatabaseName;
- }
-
- public void setJdbcUriDatabaseName(String jdbcUriDatabaseName) {
- this.jdbcUriDatabaseName = jdbcUriDatabaseName;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((itemname == null) ? 0 : itemname.hashCode());
- result = prime * result + (itemid ^ (itemid >>> 32));
- return result;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ItemsVO other = (ItemsVO) obj;
- if (itemname == null) {
- if (other.itemname != null) {
- return false;
- }
- } else if (!itemname.equals(other.itemname)) {
- return false;
- }
- if (itemid != other.itemid) {
- return false;
- }
- return true;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("ItemsVO [coltype=");
- builder.append(coltype);
- builder.append(", colname=");
- builder.append(colname);
- builder.append(", itemsManageTable=");
- builder.append(itemsManageTable);
- builder.append(", itemid=");
- builder.append(itemid);
- builder.append(", itemname=");
- builder.append(itemname);
- builder.append(", table_name=");
- builder.append(table_name);
- builder.append("]");
- return builder.toString();
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.persistence.jdbc.model;
-
-import java.time.ZonedDateTime;
-
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.openhab.core.persistence.HistoricItem;
-import org.openhab.core.types.State;
-
-/**
- * Represents the data on the part of openHAB.
- *
- * @author Helmut Lehmeyer - Initial contribution
- */
-@NonNullByDefault
-public class JdbcHistoricItem implements HistoricItem {
-
- private final String name;
- private final State state;
- private final ZonedDateTime timestamp;
-
- public JdbcHistoricItem(String name, State state, ZonedDateTime timestamp) {
- this.name = name;
- this.state = state;
- this.timestamp = timestamp;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public State getState() {
- return state;
- }
-
- @Override
- public ZonedDateTime getTimestamp() {
- return timestamp;
- }
-
- @Override
- public String toString() {
- StringBuilder builder = new StringBuilder();
- builder.append("JdbcItem [name=");
- builder.append(name);
- builder.append(", state=");
- builder.append(state);
- builder.append(", timestamp=");
- builder.append(timestamp);
- builder.append("]");
- return builder.toString();
- }
-}
+++ /dev/null
-/**
- * Copyright (c) 2010-2021 Contributors to the openHAB project
- *
- * See the NOTICE file(s) distributed with this work for additional
- * information.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License 2.0 which is available at
- * http://www.eclipse.org/legal/epl-2.0
- *
- * SPDX-License-Identifier: EPL-2.0
- */
-package org.openhab.persistence.jdbc.model;
-
-import java.util.Date;
-
-import org.eclipse.jdt.annotation.NonNullByDefault;
-import org.eclipse.jdt.annotation.Nullable;
-import org.openhab.core.persistence.PersistenceItemInfo;
-
-/**
- * Represents the item info for openHAB.
- *
- * @author Christoph Weitkamp - Initial contribution
- */
-@NonNullByDefault
-public class JdbcPersistenceItemInfo implements PersistenceItemInfo {
-
- private final String name;
- private final @Nullable Integer count;
- private final @Nullable Date earliest;
- private final @Nullable Date latest;
-
- public JdbcPersistenceItemInfo(String name) {
- this(name, null, null, null);
- }
-
- public JdbcPersistenceItemInfo(String name, @Nullable Integer count, @Nullable Date earliest,
- @Nullable Date latest) {
- this.name = name;
- this.count = count;
- this.earliest = earliest;
- this.latest = latest;
- }
-
- @Override
- public String getName() {
- return name;
- }
-
- @Override
- public @Nullable Integer getCount() {
- return count;
- }
-
- @Override
- public @Nullable Date getEarliest() {
- return earliest;
- }
-
- @Override
- public @Nullable Date getLatest() {
- return latest;
- }
-}
#sqltype.CONTACT = VARCHAR(6)
#sqltype.DATETIME = DATETIME
#sqltype.DIMMER = TINYINT
- #sqltype.LOCATION = VARCHAR(30)
+ #sqltype.LOCATION = VARCHAR(50)
#sqltype.NUMBER = DOUBLE
#sqltype.ROLLERSHUTTER = TINYINT
#sqltype.STRING = VARCHAR(65500)
</parameter>
<parameter name="sqltype.LOCATION" type="text">
<label>SqlType LOCATION</label>
- <description><![CDATA[Overrides used JDBC/SQL datatype for LOCATION <br>(optional, default: "VARCHAR(30)").]]></description>
+ <description><![CDATA[Overrides used JDBC/SQL datatype for LOCATION <br>(optional, default: "VARCHAR(50)").]]></description>
</parameter>
<parameter name="sqltype.NUMBER" type="text">
<label>SqlType NUMBER</label>