From 16302a71b97374da7e70eea626e75bcf8eb7bff2 Mon Sep 17 00:00:00 2001 From: zell Date: Wed, 22 Aug 2007 17:40:48 +0000 Subject: [PATCH] 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 --- .../samskivert/jdbc/depot/clause/SelectClause.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/java/com/samskivert/jdbc/depot/clause/SelectClause.java b/src/java/com/samskivert/jdbc/depot/clause/SelectClause.java index 8bca1902..66b4cddb 100644 --- a/src/java/com/samskivert/jdbc/depot/clause/SelectClause.java +++ b/src/java/com/samskivert/jdbc/depot/clause/SelectClause.java @@ -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 extends QueryClause public void addClasses (Collection> classSet) { classSet.add(_pClass); + + // TODO: This should not have to do a getAnnotation(). + Computed computed = _pClass.getAnnotation(Computed.class); + if (computed != null) { + Class shadowClass = computed.shadowOf(); + if (shadowClass != null) { + classSet.add(shadowClass); + } + } + if (_fromOverride != null) { _fromOverride.addClasses(classSet); }