[ 
https://issues.apache.org/jira/browse/OPENJPA-483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13651919#comment-13651919
 ] 

René Link commented on OPENJPA-483:
-----------------------------------

Hi,

first of all I use openjpa 2.2.1 at the moment.

I had a similar proplem with the openjpa.jdbc.Schemas property and found out 
that you must set the full table name instead of just schemas.
For example:
If you have a schema named DEV and tables named USER, ROLE you must set 
openjpa.jdbc.Schemas=DEV.USER,DEV.ROLE.
Otherwise openjpa will not see these tables because no metadata is build for 
them.
The problem is in the 
org.apache.openjpa.jdbc.schema.SchemaGenerator.isAllowedTable method.
When openjpa initializes the schema during startup it looks up the database 
metadata via JDBC.
After that it filters all tables that do not match the tables in the 
openjpa.jdbc.Schemas property. I think this
is the problem or a misunderstanding of the meaning of schema.

My recomendation is to NOT use the openjpa.jdbc.Schemas property or explicitly 
declare all tables (with schema) that openjpa should see.

                
> config for openjpa.jdbc.Schemas not applied to SQL (HSQL)
> ---------------------------------------------------------
>
>                 Key: OPENJPA-483
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-483
>             Project: OpenJPA
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>         Environment: Java JDK 1.5.0_12, Linux, Hypersonic DB
>            Reporter: Adam Hardy
>         Attachments: HSQLDB-openjpa Test.zip, schemabug2.zip, schemabug.zip
>
>
> OpenJPA should be able to see and access schemas but doesn't. 
> I configured this with openjpa.jdbc.Schema=DEV (my schema name) 
> I also tried putting the schema name everywhere possible in the metadata, 
> i.e. in the <schema>DEV</schema> tags and in table tags, and in:
>   <persistence-unit-metadata>
>     <xml-mapping-metadata-complete />
>     <persistence-unit-defaults>
>       <schema>DEV</schema>
>     </persistence-unit-defaults>
>   </persistence-unit-metadata>
> I will include a zipped up test project illustrating the problem. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to