Guys,

Here's a solution that should work for you.  We're not ready to commit
such an intrusive change (yes it would be) for what is probably a rare
need.  But what we can do is provide you with the tools to better
extend the framework without hacks.

What we'll add is a method to SqlMapClient with the following signature:

boolean containsStatement (String statementName)

Since SqlMapClient is an interface, you can easily insert your own
implementation between the interface and our default.  Your
implementation can use the containsStatement() method to check for the
.{dbtype} statement, and if it doesn't exist, you can fallback to the
generic one.

That should solve this issue without "hacks".

Thoughts?

Clinton


On Tue, 29 Mar 2005 01:25:16 +0200 (CEST), Vadim Pesochinskiy (JIRA)
<[email protected]> wrote:
>      [ 
> http://issues.apache.org/jira/browse/IBATIS-87?page=comments#action_61684 ]
> 
> Vadim Pesochinskiy commented on IBATIS-87:
> ------------------------------------------
> 
> This solution will help to create custom work-arounds. I believe implementing 
> this feature will add a lot of value for a little effort.
> 
> > Add notion of DB specific SQL statements
> > ----------------------------------------
> >
> >          Key: IBATIS-87
> >          URL: http://issues.apache.org/jira/browse/IBATIS-87
> >      Project: iBatis for Java
> >         Type: New Feature
> >   Components: SQL Maps
> >  Environment: Any
> >     Reporter: Vadim Pesochinskiy
> >     Priority: Minor
> 
> >
> > This is probably not very impressive idea, but I will throw it in anyway.
> > What if we add a DatabaseType property and have SqlMap lookup proper query 
> > for it in the same manner as Java internationalization works. DB type 
> > attribute can have an arbitrary value, which is only used get proper query.
> > E.g.
> > Queries:
> >   getOrder.sqlserver
> >   getOrder
> > If DataBaseType is 'sqlserver' - 'getOrder.sqlserver' query is picked, if 
> > DataBaseType=oracle or DataBaseType=postgres 'getOrder' sql will be 
> > executed.
> > I can implement it, if you don't mind :). Thanks.
> 
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators:
>    http://issues.apache.org/jira/secure/Administrators.jspa
> -
> If you want more information on JIRA, or have a bug to report see:
>    http://www.atlassian.com/software/jira
> 
>

Reply via email to