Let's do that abstract check up here as well.

This commit is contained in:
Michael Bayne
2007-04-19 21:27:18 +00:00
parent b4051ef67e
commit 17c6e9a2f6
@@ -146,10 +146,12 @@ public class GenRecordTask extends Task
return;
}
// determine which fields make up our primary key; we'd just use Class.getFields() but that
// returns things in a random order whereas ClassUtil returns fields in declaration order
// starting from the top-most class and going down the line
// determine our primary key fields for getKey() generation (if we're not an abstract)
List<Field> kflist = new ArrayList<Field>();
if (!Modifier.isAbstract(oclass.getModifiers())) {
// determine which fields make up our primary key; we'd just use Class.getFields() but
// that returns things in a random order whereas ClassUtil returns fields in
// declaration order starting from the top-most class and going down the line
FIELD_LOOP:
for (Field field : ClassUtil.getFields(oclass)) {
// iterate becase getAnnotation() fails if we're dealing with multiple classloaders
@@ -160,6 +162,7 @@ public class GenRecordTask extends Task
}
}
}
}
// determine which fields we need to generate constants for
List<Field> flist = new ArrayList<Field>();
@@ -278,8 +281,8 @@ public class GenRecordTask extends Task
// generate our methods section
StringBuilder msection = new StringBuilder();
// add a getKey() method, if applicable (and we're not abstract)
if (!Modifier.isAbstract(oclass.getModifiers()) && kflist.size() > 0) {
// add a getKey() method, if applicable
if (kflist.size() > 0) {
// create our velocity context
VelocityContext ctx = new VelocityContext();
ctx.put("record", rname);