It might be better to write a plugin that manipulates the generated
method? 

-----Original Message-----
From: Ben Shory [mailto:be...@sapiens.com] 
Sent: Monday, January 12, 2009 11:13 AM
To: user-java@ibatis.apache.org
Subject: SQL selector

Hi,
Before any statement execution, I would like to first check if it has a
vendor specific implementation and execute it if so or the default one
if not.
My DAOs are generated as spring dao with ibator.
I thought of doing something like -

        String stmtId = "table"+spec_postfix+".countByExample";
        if(!statementExists(stmtId)) {
                stmtId = "table.countByExample";
        }
        Integer count = (Integer)
getSqlMapClientTemplate().queryForObject(stmtId,
                        example);
        return count;

Is this a good approach?
Would I have to override SpringDAOTemplae?

Reply via email to