[jboss-jira] [JBoss JIRA] Commented: (JBIDE-359) hibernate reverse engineering does not set "schema" attribute in .hbm.xml
bugra uytun (JIRA)
jira-events at jboss.com
Mon Sep 4 12:01:43 EDT 2006
[ http://jira.jboss.com/jira/browse/JBIDE-359?page=comments#action_12342753 ]
bugra uytun commented on JBIDE-359:
-----------------------------------
After reading your comment I noticed that I wasn't precise enough and left room for misunderstanding, so I would like to explain it in more detail.
My DB (Apache Derby 10.1) uses as default schema "APP" but the tables I need are in "mySchema" schema where also the table "MY_TABLE" resides. To get the correct schema and the tables I needed to define the "hibernate.default_schema" property in .cfg.xml file - this doesn't mean that this must be the same default schema in my DB. But since the reverse engineered automagically generated .hbm.xml files do not contain the "schema" attribute hibernate tries to find the tables in the default schema - in this case in "APP" but this schema does not have such a table.
To get the correct table from correct schema I have to add the "schema" attribute to all generated .hbm.xml files by hand or I have to set he default schema on my DB to what I need - in this case to "mySchema".
I hope that I could clarify my position and I would appreciate if you reconsider this bug/whish list/etc. In case that I'm missing an already existing feature/checkbox/etc. I would be happy to use this and sorry for the annoyance.
> hibernate reverse engineering does not set "schema" attribute in .hbm.xml
> -------------------------------------------------------------------------
>
> Key: JBIDE-359
> URL: http://jira.jboss.com/jira/browse/JBIDE-359
> Project: JBoss IDE
> Issue Type: Bug
> Components: Hibernate Tools
> Environment: windows xp, eclipse 3.2, hibernate tools 3.2.0.b7
> Reporter: bugra uytun
> Assigned To: Max 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 jboss-jira
mailing list