Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 355801
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:03:06+00:00 2026-05-12T12:03:06+00:00

Resolution: No I’m no longer extending the original parent. Original: Is there a way

  • 0

Resolution: No I’m no longer extending the original parent.

Original:
Is there a way to annotate an inherited final setter method? I am extending a class which has a final setter which I would like to @Autowire with Spring. The parent class is from a library and cannot be modified.

A workaround I have found is to write a proxy method, but this seems like more work than necessary.

public abstract class SqlMapClientDaoSupport ... {
    public final void setSqlMapClient(SqlMapClient smc) {
        ...
    }
}

@Component
public class AccountDao extends SqlMapClientDaoSupport {
    // all this just to annotate an existing method?
    @Autowire
    public final void setSqlMapClientWorkaround(SqlMapClient smc) {
        super.setSqlMapClient(smc);
    }
}

Edit 1: Above example modified to reflect use case:
The use case is implementing DAO objects for Ibatis/Spring
which extend a common base class. Each DAO needs the same
property set, and each needs to be configured as a bean. I currently
do this by configuring each individually in applicationContext.xml.

<bean id="accountDAO" 
  class="com.example.proj.dao.h2.AccountDAOImpl"
  p:sqlMapClient-ref="sqlMapClient" />
<bean id="companyDAO" 
  class="com.example.proj.dao.h2.CompanyDAOImpl"
  p:sqlMapClient-ref="sqlMapClient" />
<!-- etc... -->

I would prefer to use component-scan to discover and autowire the DAO
objects automatically, which I can’t copy/paste botch.

<context:component-scan base-package="com.example.proj.dao.h2" />

I do not see in the annotation guide how one would annotate a
property/member other than where declared. I’m hoping that is
something I’m missing though.

Edit 2: I am no longer extending the SqlMapClientDaoSupport class, instead my AccountDao is a POJO which implements what little functionality was being provided by the Support class. This allows me to use @Autowire at will.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:03:06+00:00Added an answer on May 12, 2026 at 12:03 pm

    No, there is no way to annotate an inherited final method.

    Rather than extend the support class (SqlMapClientDaoSupport) I reimplemented it in my project (it’s behavior is minimal) annotating the methods as needed, and my DAO extend that support class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(ARP = Address Resolution Protocol - RFC 826) Is there a way to send
We have a high-resolution PDF (for printing) which has some form fields on it.
With the new screen resolution and aspect ratio of iPhone 5 it seems there
i m decreasing the resolution of a bitmap. i found a method on a
Possible Duplicate: C++ overload resolution I ran into a problem where after my class
I've got a very high resolution image which is meant to be displayed on
Possible Duplicates: C++ overload resolution Why does an overridden function in the derived class
How to retain the resolution of an image while reducing or expanding... Is there
Do functional languages bring anything in the resolution of everyday business problems? Are there
Since the display resolution is different, I wonder if there is an official guide

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.