Automatically add the shadow to our type set for @Computed(shadowOf=FooRecord)

record classes.
This commit is contained in:
Michael Bayne
2008-09-06 02:38:20 +00:00
parent 9a7a78080c
commit d5619a3b28
2 changed files with 10 additions and 10 deletions
@@ -169,8 +169,17 @@ public class DepotTypes
if (_classMap.containsKey(type)) {
return;
}
_classMap.put(type, ctx.getMarshaller(type));
// add the class in question
DepotMarshaller<?> marsh = ctx.getMarshaller(type);
_classMap.put(type, marsh);
_classIx.put(type, _classIx.size());
// if this class is @Computed and has a shadow, add its shadow
if (marsh.getComputed() != null &&
!PersistentRecord.class.equals(marsh.getComputed().shadowOf())) {
addClass(ctx, marsh.getComputed().shadowOf());
}
}
/**
@@ -175,15 +175,6 @@ public class SelectClause<T extends PersistentRecord> extends QueryClause
{
classSet.add(_pClass);
// TODO: This should not have to do a getAnnotation().
Computed computed = _pClass.getAnnotation(Computed.class);
if (computed != null) {
Class<? extends PersistentRecord> shadowClass = computed.shadowOf();
if (!PersistentRecord.class.equals(shadowClass)) {
classSet.add(shadowClass);
}
}
if (_fromOverride != null) {
_fromOverride.addClasses(classSet);
}