Automatically add the shadow to our type set for @Computed(shadowOf=FooRecord)
record classes.
This commit is contained in:
@@ -169,8 +169,17 @@ public class DepotTypes
|
|||||||
if (_classMap.containsKey(type)) {
|
if (_classMap.containsKey(type)) {
|
||||||
return;
|
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());
|
_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);
|
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) {
|
if (_fromOverride != null) {
|
||||||
_fromOverride.addClasses(classSet);
|
_fromOverride.addClasses(classSet);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user