Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Commit

Permalink
Fix sqltype.table* options
Browse files Browse the repository at this point in the history
Options `sqltype.tablePrimaryKey` and `sqltype.tablePrimaryValue` were not read
correctly. They were treated as yet another item type which didn't match their use
in the code.
  • Loading branch information
skazi0 committed Feb 25, 2019
1 parent 424d919 commit 7d6fa62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bundles/persistence/org.openhab.persistence.jdbc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ This service can be configured in the file `services/jdbc.cfg`.
| sqltype.ROLLERSHUTTER | `TINYINT` | No | see above |
| sqltype.STRING | `VARCHAR(65500)` | No | see above |
| sqltype.SWITCH | `VARCHAR(6)` | No | see above |
| sqltype.TABLEPRIMARYKEY | `TIMESTAMP` | No | see above |
| sqltype.TABLEPRIMARYVALUE | `NOW()` | No | see above |
| sqltype.tablePrimaryKey | `TIMESTAMP` | No | type of `time` column for newly created item tables |
| sqltype.tablePrimaryValue | `NOW()` | No | value of `time` column for newly inserted rows |
| numberDecimalcount | 3 | No | for Itemtype "Number" default decimal digit count |
| tableNamePrefix | `item` | No | table name prefix. For Migration from MySQL Persistence, set to `Item`. |
| tableUseRealItemNames | `false` | No | table name prefix generation. When set to `true`, real item names are used for table names and `tableNamePrefix` is ignored. When set to `false`, the `tableNamePrefix` is used to generate table names with sequential numbers. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ private void setSqlTypes() {
if (!matcher.group(1).equals("sqltype")) {
continue;
}
String itemType = matcher.group(2).toUpperCase() + "ITEM";
String itemType = matcher.group(2);
if (!itemType.startsWith("table")) {
itemType = itemType.toUpperCase() + "ITEM";
}
String value = (String) configuration.get(key);
logger.debug("JDBC::updateConfig: set sqlTypes: itemType={} value={}", itemType, value);
dBDAO.sqlTypes.put(itemType, value);
Expand Down

0 comments on commit 7d6fa62

Please sign in to comment.