You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Scott Z (JIRA)" <ib...@incubator.apache.org> on 2005/03/25 22:21:16 UTC
[jira] Created: (IBATIS-94) Add functions to fetch sqlmap metadata
Add functions to fetch sqlmap metadata
--------------------------------------
Key: IBATIS-94
URL: http://issues.apache.org/jira/browse/IBATIS-94
Project: iBatis for Java
Type: New Feature
Components: SQL Maps
Versions: 2.0.9
Reporter: Scott Z
Priority: Minor
I wonder if we can add some getter functions to the SqlMapClient interface for the sqlmap metadata information, such as a list of statements, or maybe even datasource settings. This information is currently used by us for supporting database specific queries and might be useful for others too.
I know I can get this information if I do something like:
SqlMapExecutorDelegate delegate = ((ExtendedSqlMapClient)sqlMap).getDelegate();
then call delegate.getMappedStatementNames();
But I don't want to depend on the implementation just in case it changes.
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
[jira] Commented: (IBATIS-94) Add functions to fetch sqlmap metadata
Posted by "Bubba Puryear (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-94?page=comments#action_12312928 ]
Bubba Puryear commented on IBATIS-94:
-------------------------------------
We'd like to be able to read resultMaps (read only) so that we can get the column name for a mapped bean property. This would be useful for dynamic order-by clauses. (we don't want to hard code the column names that map to properties somewhere else in our app since we already define the mapping in the SqlMaps config files)
> Add functions to fetch sqlmap metadata
> --------------------------------------
>
> Key: IBATIS-94
> URL: http://issues.apache.org/jira/browse/IBATIS-94
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Scott Z
> Priority: Minor
>
> I wonder if we can add some getter functions to the SqlMapClient interface for the sqlmap metadata information, such as a list of statements, or maybe even datasource settings. This information is currently used by us for supporting database specific queries and might be useful for others too.
> I know I can get this information if I do something like:
> SqlMapExecutorDelegate delegate = ((ExtendedSqlMapClient)sqlMap).getDelegate();
> then call delegate.getMappedStatementNames();
> But I don't want to depend on the implementation just in case it changes.
> 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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (IBATIS-94) Add functions to fetch sqlmap metadata
Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-94?page=comments#action_61674 ]
Brandon Goodin commented on IBATIS-94:
--------------------------------------
I think this might be a good way to keep folks satisfied who need more info on _read-only_ configuration settings. It would also keep people from getting themselves into unstable hacked code workarounds. Been there done that... no fun ;-) Thanks for this suggestion Scott.
> Add functions to fetch sqlmap metadata
> --------------------------------------
>
> Key: IBATIS-94
> URL: http://issues.apache.org/jira/browse/IBATIS-94
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Scott Z
> Priority: Minor
>
> I wonder if we can add some getter functions to the SqlMapClient interface for the sqlmap metadata information, such as a list of statements, or maybe even datasource settings. This information is currently used by us for supporting database specific queries and might be useful for others too.
> I know I can get this information if I do something like:
> SqlMapExecutorDelegate delegate = ((ExtendedSqlMapClient)sqlMap).getDelegate();
> then call delegate.getMappedStatementNames();
> But I don't want to depend on the implementation just in case it changes.
> 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
[jira] Commented: (IBATIS-94) Add functions to fetch sqlmap metadata
Posted by "Vadim Pesochinskiy (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-94?page=comments#action_62738 ]
Vadim Pesochinskiy commented on IBATIS-94:
------------------------------------------
Scott, I am trying to figure out how you did that trick. I am extending SqlMapDaoTemplate and in constructor trying to get all the names. I am not sure how you get that sqlMap, which you cast to ExtendedSqlMapClient, to call getMappedStatementNames.
When I call getSqlMapExecutor() from constructor, I am getting exception listed below.
java.lang.NullPointerException
at com.ibatis.dao.engine.impl.StandardDaoManager.getTransaction(StandardDaoManager.java:108)
at com.ibatis.dao.client.template.SqlMapDaoTemplate.getSqlMapExecutor(SqlMapDaoTemplate.java:60)
at com.oatsystems.epod.persistence.ibatis.SqlMapDaoTemplateExt.init(SqlMapDaoTemplateExt.java:63)
at com.oatsystems.epod.persistence.ibatis.SqlMapDaoTemplateExt.<init>(SqlMapDaoTemplateExt.java:38)
at com.oatsystems.epod.persistence.sqlmap.impl.TroubleTicketModelSqlMap.<init>(TroubleTicketModelSqlMap.java:39)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseDao(XmlDaoManagerBuilder.java:221)
at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.parseContext(XmlDaoManagerBuilder.java:158)
at com.ibatis.dao.engine.builder.xml.XmlDaoManagerBuilder.buildDaoManager(XmlDaoManagerBuilder.java:100)
at com.ibatis.dao.client.DaoManagerBuilder.buildDaoManager(DaoManagerBuilder.java:59)
> Add functions to fetch sqlmap metadata
> --------------------------------------
>
> Key: IBATIS-94
> URL: http://issues.apache.org/jira/browse/IBATIS-94
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Scott Z
> Priority: Minor
>
> I wonder if we can add some getter functions to the SqlMapClient interface for the sqlmap metadata information, such as a list of statements, or maybe even datasource settings. This information is currently used by us for supporting database specific queries and might be useful for others too.
> I know I can get this information if I do something like:
> SqlMapExecutorDelegate delegate = ((ExtendedSqlMapClient)sqlMap).getDelegate();
> then call delegate.getMappedStatementNames();
> But I don't want to depend on the implementation just in case it changes.
> 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
[jira] Commented: (IBATIS-94) Add functions to fetch sqlmap metadata
Posted by "Vadim Pesochinskiy (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATIS-94?page=comments#action_62744 ]
Vadim Pesochinskiy commented on IBATIS-94:
------------------------------------------
I figured it out, it works if I do it outside of constructor.
I am wondering how do you get access to the name of properties file in sqlMapConfig?
E.g. <sqlMapConfig>
<properties resource="jdbc.properties"/>
> Add functions to fetch sqlmap metadata
> --------------------------------------
>
> Key: IBATIS-94
> URL: http://issues.apache.org/jira/browse/IBATIS-94
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> Versions: 2.0.9
> Reporter: Scott Z
> Priority: Minor
>
> I wonder if we can add some getter functions to the SqlMapClient interface for the sqlmap metadata information, such as a list of statements, or maybe even datasource settings. This information is currently used by us for supporting database specific queries and might be useful for others too.
> I know I can get this information if I do something like:
> SqlMapExecutorDelegate delegate = ((ExtendedSqlMapClient)sqlMap).getDelegate();
> then call delegate.getMappedStatementNames();
> But I don't want to depend on the implementation just in case it changes.
> 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