Hello,
I use a MySQL 5.0 Database server and hibernate 3.0.5.
I've created 2 schemas (called Databases by MySQL) : "schema_commun" and "client_pca".
And in each schema, several tables, for example : client_pca_statut in the schema client_pca.
The config file for the datasource is :
Code:
<connection-url>jdbc:mysql://localhost:3306/SCHEMA_COMMUN</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<user-name>my_user</user-name>
I think it means "application connects to the database server with the user "my_user" and on the default schema "SCHEMA_COMMUN"" But maybe i'm wrong.
And when i launch the application, hibernate throws that Exception :
Table '
schema_commun.
client_pca_client_pca_statut' doesn't exist.
It's looking for a table named "client_pca_client_pca_statut" in the schema "schema_commun". But What i want it looks for is a table named "client_pca_statut" in the schema "client_pca".
The beginning of the mapping file is:
Code:
<hibernate-mapping default-cascade="none" auto-import="true" default-lazy="false" schema="CLIENT_PCA">
The beginnnig of the part about the concerned class is:
Code:
<class name="com.client.domain.StatutClient" table="CLIENT_PCA_STATUT">
On the other hand, in command line, once connected with user "my_sql", default schema "SCHEMA_COMMUN", if I type in command-line : SELECT * FROM CLIENT_PCA.client_pca_statut;
I get the rows without problem.
This configuration with several schema was used with an Oracle server and was completly operationnal.
Anybody have an idea on how to configure hibernate for doing what i want ?
Thank you in advance,
Jean