ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ben Shory" <be...@sapiens.com>
Subject SQL selector
Date Mon, 12 Jan 2009 09:12:59 GMT
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?


Mime
View raw message