summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gmail.com>2012-09-21 08:18:25 -0400
committerJames Moger <james.moger@gmail.com>2012-09-21 08:18:25 -0400
commitb4c987d43004727b860b5b4cd1b6d24fe4c5e361 (patch)
treeb010fa586b3697f4af5e78cc75ef066fed779a1b /src
parent53bc79dbe434e61765356ff193ac4665947c32a0 (diff)
downloadiciql-b4c987d43004727b860b5b4cd1b6d24fe4c5e361.tar.gz
iciql-b4c987d43004727b860b5b4cd1b6d24fe4c5e361.zip
Support inheritance of IQVersion for DbUpgrader implementations (issue 10)
Diffstat (limited to 'src')
-rw-r--r--src/com/iciql/Db.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/iciql/Db.java b/src/com/iciql/Db.java
index d436b8d..90e7613 100644
--- a/src/com/iciql/Db.java
+++ b/src/com/iciql/Db.java
@@ -311,6 +311,13 @@ public class Db {
upgradeChecked.add(dbUpgrader.getClass());
IQVersion model = dbUpgrader.getClass().getAnnotation(IQVersion.class);
+ if (model.value() == 0) {
+ // try superclass
+ Class<?> superClass = dbUpgrader.getClass().getSuperclass();
+ if (superClass.isAnnotationPresent(IQVersion.class)) {
+ model = superClass.getAnnotation(IQVersion.class);
+ }
+ }
if (model.value() > 0) {
DbVersion v = new DbVersion();
// (SCHEMA="" && TABLE="") == DATABASE