[
http://issues.apache.org/jira/browse/IBATIS-87?page=comments#action_61578 ]
Scott Z commented on IBATIS-87:
-------------------------------
I have the same idea too. Actually, to make it work even more like java
resource lookup (internalization) is that, it will first look for db specific
queries, getFoo.{dbType}, and if it's not there, fall back to just "getFoo",
which is the generic sql works for all databases. This way, you don't need the
redundant queries for the ones that are common to all databases. Right now, we
kind of implemented this on our side, we keep a map of statement after the sql
map is parsed, then when a query is being executed, we first look for the db
specific query (stamentname + ".{dbType}"), if it doesn't find it, it then use
the original statement.
> 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