diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java index 043db492f..f8d8ecb35 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java @@ -66,8 +66,11 @@ public abstract class ColumnVersionStrategy * column index uses. Only used if the version strategy employs more than * one column. */ - protected abstract int getJavaType(int i); - + protected int getJavaType(int i) { + throw new AbstractMethodError( + _loc.get("multi-column-version-unsupported",getAlias()).toString()); + } + /** * Return the next version given the current one, which may be null. */ diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/NumberVersionStrategy.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/NumberVersionStrategy.java index e7e0750c7..ab5fc749d 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/NumberVersionStrategy.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/NumberVersionStrategy.java @@ -60,10 +60,6 @@ public class NumberVersionStrategy return JavaTypes.INT; } - protected int getJavaType(int i) { - throw new InternalException("multi-column-version-not-supported"); - } - protected Object nextVersion(Object version) { if (version == null) return _initial; diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/TimestampVersionStrategy.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/TimestampVersionStrategy.java index 42da3e421..880dba660 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/TimestampVersionStrategy.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/TimestampVersionStrategy.java @@ -45,10 +45,6 @@ public class TimestampVersionStrategy return JavaSQLTypes.TIMESTAMP; } - protected int getJavaType(int i) { - throw new InternalException("multi-column-version-not-supported"); - } - protected Object nextVersion(Object version) { return new Timestamp(System.currentTimeMillis()); } diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties index 7a12b9fb2..0ba49e3f2 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties @@ -137,3 +137,6 @@ unmapped-datastore-value: Instances of type "{0}" are not valid query \ cache-hit: SQL Cache hit with key: {0} in {1} cache-missed: SQL Cache missed with key: {0} in {1} cant-set-value: Field "{1}" of "{0}" can not be set to "{2}" value. +multi-column-version-unsupported:You have specified more than one column for \ + version data, but the "{1}" version strategy does not support multi-column \ + versioning. \ No newline at end of file