[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-238) Specifying a schema in @Table does not work with MySQL
Bryan Hunt (JIRA)
noreply at atlassian.com
Fri Dec 15 18:10:04 EST 2006
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-238?page=comments#action_25642 ]
Bryan Hunt commented on EJB-238:
--------------------------------
I've debugged this a bit more using the latest MySQL and here is an update.
If you specify a schema using @Table (schema = "my_schema") and your connection url does not use my_schema as the database ie: jdbc:mysql://localhost/test, there is an exception thrown inside hibernate that says you don't have create permission. The only way for this to work is if the schema matches the database ie:
@Table(schema = "clients")
jdbc:mysql://localhost/clients
This becomes non-portable when you move to a database that supports schemas within a database such as DB2. In the case of DB2, the following works as expected:
@Table(schema = "clients")
jdbc:db2://localhost:50001/store_database
> Specifying a schema in @Table does not work with MySQL
> ------------------------------------------------------
>
> Key: EJB-238
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-238
> Project: Hibernate Entity Manager
> Type: Bug
> Components: EntityManager
> Versions: 3.2.0.cr2
> Reporter: Bryan Hunt
>
>
> If you specify a schema in an @Table annotation, the table will not be created when using Hibernate with MySQL. If you remove the schema, the table is created just fine.
--
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