[jbosstools-issues] [JBoss JIRA] Commented: (JBIDE-359) hibernate reverse engineering does not set "schema" attribute in .hbm.xml

Juan Carlos Valverde (JIRA) jira-events at lists.jboss.org
Thu May 15 16:51:22 EDT 2008


    [ http://jira.jboss.com/jira/browse/JBIDE-359?page=comments#action_12412934 ] 
            
Juan Carlos Valverde commented on JBIDE-359:
--------------------------------------------

Hi, I'm working with Oracle and this issue is causing me problems too. My problem is as follows:

1. For the <foreign-key> tag of the hibernate.reveng.xml file to work I have to set the hibernate.default_catalog to property "" (since Oracle has no catalogs) and the hibernate.default_schema property to "<my-schema-name>" in the hibernate.cfg.xml file.

2. In this case the schema name is the name of the user that owns the tables, so to actually use the tables I need the schema to be included in the @Table annotation.

3. I cannot use <schema-selection> to solve my problem because no matter what I do if I don't set the default_catalog and default_schema in the hibernate.cfg.xml the tool simply ignores my <foreign-key> tag.

I'll check the tools forum, but I wanted to post this message here since this is where my searches lead me.

Regards.

> hibernate reverse engineering does not set "schema" attribute in .hbm.xml
> -------------------------------------------------------------------------
>
>                 Key: JBIDE-359
>                 URL: http://jira.jboss.com/jira/browse/JBIDE-359
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: Hibernate
>         Environment: windows xp, eclipse 3.2, hibernate tools 3.2.0.b7
>            Reporter: bugra uytun
>         Assigned To: Max Rydahl Andersen
>
> i set the schema in hibernate.cfg.xml with:
> ---
> <property name="hibernate.default_schema">mySchema</property>
> ---
> after reverse engineering the DB I get the .hbm.xml file
> ---
> ...
> <hibernate-mapping>
>     <class name="com.someclass" table="MY_TABLE">
> ...
> ---
> notice the missing 'schema="mySchema"'. if you're not using the default DB schema without this attribute you will get the following error:
> ---
> org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not load an entity: [com.someclass#1];
> ---

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

        



More information about the jbosstools-issues mailing list