Hello everyone,
currently I'm experiencing some strange behaviour when using inheritance on one of my classes.
The class ReminderReport is derived from InvoiceReport since they share a lot of common functionality.
Most of my application uses annotations for configuration, so I annotatedandCode:@Component("reminderReport") public class ReminderReport extends InvoiceReport
as usual.Code:@Component("invoiceReport") public class InvoiceReport extends AddressedReport<Invoice>
Now when I try to inject the InvoiceReport into another bean, like so:
Spring injects a ReminderReport, which would probably make sense in another context but of course is not what I want in this case.Code:@Resource private InvoiceReport invoiceReport
I tried addingto both InvoiceReport class and injected field, but unfortunately that didn't help.Code:@Qualifier("invoice")
Probably I'll just try and configure the beans via a separate XML file for the moment (to force instantiation of InvoiceReport as a separate class) and see if that works for me.
In the long run, annotation-based configuration would be much preferable, though.
Best regards
Marcus


Reply With Quote
