diff options
author | James Moger <james.moger@gmail.com> | 2012-09-21 08:18:25 -0400 |
---|---|---|
committer | James Moger <james.moger@gmail.com> | 2012-09-21 08:18:25 -0400 |
commit | b4c987d43004727b860b5b4cd1b6d24fe4c5e361 (patch) | |
tree | b010fa586b3697f4af5e78cc75ef066fed779a1b /src | |
parent | 53bc79dbe434e61765356ff193ac4665947c32a0 (diff) | |
download | iciql-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.java | 7 |
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
|