rzo1 commented on code in PR #157:
URL: https://github.com/apache/openjpa/pull/157#discussion_r3887168602


##########
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java:
##########
@@ -2223,6 +2240,43 @@ protected int getDateFractionDigits(Column col, String 
typeName) {
         return dateFractionDigits;
     }
 
+    /**
+     * Return the type name to use as the target of a CAST to a 64 bit integer.
+     * Defaults to {@link #bigintTypeName} unless {@link #longCastTypeName} 
was set explicitly.
+     */
+    public String getLongCastTypeName() {
+        return longCastTypeName != null ? longCastTypeName : bigintTypeName;
+    }
+
+    /**
+     * Return the type name to use as the target of a CAST of a numeric value 
to the given java type.
+     * Any DDL size marker (<code>{0}</code>) is stripped, as CAST targets are 
not sized by the schema.
+     */
+    public String getNumberCastTypeName(Class<?> type) {
+        String name;
+        if (type == int.class || type == Integer.class) {
+            name = integerCastTypeName;
+        } else if (type == long.class || type == Long.class) {
+            name = getLongCastTypeName();
+        } else if (type == float.class || type == Float.class) {
+            name = floatTypeName;
+        } else {
+            name = doubleTypeName;
+        }
+        return insertSize(name, null);

Review Comment:
   done



-- 
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]

Reply via email to