[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-5333) Dynamically setting schema name for native queries in hbm file

Strong Liu (JIRA) noreply at atlassian.com
Thu Jun 24 01:38:09 EDT 2010


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Strong Liu resolved HHH-5333.
-----------------------------

      Assignee: Strong Liu
    Resolution: Duplicate

duplicated by HHH-2576

> Dynamically setting schema name for native queries in hbm file
> --------------------------------------------------------------
>
>                 Key: HHH-5333
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5333
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: query-sql
>    Affects Versions: 3.2.2, 3.3.0.SP1, 3.3.2
>            Reporter: Niraj Gadgilwar
>            Assignee: Strong Liu
>
> Hi ,
> inside my hibernate.cfg.xml I am mentioning
> hibernate.default_schema as schema name (say "testSchema") and it is working with named queries and HQL as expected.But when I am using a native sql query
> <sql-query name="myQuery">
>    <return-scalar column="NAME" type="java.lang.String"/>
>    <return-scalar column="SURNAME" type="java.lang.String"/>
>    SELECT NAME,SURNAME FROM ${hibernate.default_schema}.TBEMPLOYEE
> </sql-query> 
> In that case the schema name(i.e. testSchema)is not getting appended to the table names.
> I tried this for Hibernate version 3.3.0 and 3.3.2. But it is not working. 
>  
> Can anybody provide me the correct implementation ? Do anyone know correct syntax? 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list