Automatically bring any shadowOf class into play without an explicit FromOverride clause. This needs some more thought.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2207 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
zell
2007-08-22 17:40:48 +00:00
parent 5b22ae2d69
commit 16302a71b9
@@ -28,6 +28,7 @@ import java.util.Map;
import com.samskivert.jdbc.depot.PersistentRecord;
import com.samskivert.jdbc.depot.WhereClause;
import com.samskivert.jdbc.depot.annotation.Computed;
import com.samskivert.jdbc.depot.expression.ExpressionVisitor;
/**
@@ -160,6 +161,16 @@ public class SelectClause<T extends PersistentRecord> extends QueryClause
public void addClasses (Collection<Class<? extends PersistentRecord>> classSet)
{
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 (shadowClass != null) {
classSet.add(shadowClass);
}
}
if (_fromOverride != null) {
_fromOverride.addClasses(classSet);
}