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

record classes.


git-svn-id: https://samskivert.googlecode.com/svn/trunk@2404 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2008-09-06 02:38:20 +00:00
parent e1f211dc8e
commit 5b6d4895e8
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);
}