rzo1 commented on code in PR #163:
URL: https://github.com/apache/openjpa/pull/163#discussion_r3868788626
##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java:
##########
@@ -315,7 +315,18 @@ public class DBDictionary
// types
public boolean storageLimitationsFatal = false;
public boolean storeLargeNumbersAsStrings = false;
+ /**
+ * Whether Java <code>char</code> fields are stored in numeric columns
+ * rather than as <code>CHAR</code> values. Dictionaries may set their own
+ * default and may adjust it in {@link #connectedConfiguration(Connection)}
+ * based on the detected database version; use
+ * {@link #setStoreCharsAsNumbers(boolean)} to configure a value that is
+ * guaranteed to be left untouched (OPENJPA-2971).
+ */
public boolean storeCharsAsNumbers = true;
+ // true once the user explicitly configured StoreCharsAsNumbers;
dictionaries
+ // must not auto-detect over such a value (OPENJPA-2971)
+ private boolean storeCharsAsNumbersExplicit = false;
Review Comment:
storeCharsAsNumbersExplicit is used, just not directly:
- written in setStoreCharsAsNumbers (DBDictionary.java:6052)
- read by isStoreCharsAsNumbersExplicit() (DBDictionary.java:6062)
- which is called from PostgresDictionary.connectedConfiguration
(PostgresDictionary.java:1073): if (maj < 9 && !isStoreCharsAsNumbersExplicit())
Same for the setter: it looks unused because nothing calls it by name, but
Options.matchOptionToMember resolves a plugin property to a setter method first
and only falls back to the public field, so postgres(StoreCharsAsNumbers=true)
goes through it.
(the getter is unused but there for consistency)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]