openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gilbertoca <gilbert...@gmail.com>
Subject Re: ReverseMappingTool: generate orm.xml from Database schema
Date Wed, 06 Jan 2010 17:22:50 GMT

I found NPE cause! 
I have to change the openjpa.jdbc.DBDictionary property to
org.apache.openjpa.jdbc.sql.PostgresDictionary. 
It was H2Dictionary. Sorry!

But even so it generates nothing:

gilberto@SUGEP-DMASI:~/dev/netbeans-config/park-jpa/core> java -cp
/home/gilberto/.m2/repository/postgresql/postgresql/8.3-603.jdbc3/postgresql-8.3-603.jdbc3.jar:/home/gilberto/.m2/repository/org/apache/openjpa/openjpa-all/2.0.0-M3/openjpa-all-2.0.0-M3.jar
org.apache.openjpa.jdbc.meta.ReverseMappingTool -d src/ -p
target/classes/META-INF/persistence.xml
25  parkPU  INFO   [main] openjpa.Tool - The reverse mapping tool will run
on the database.  The tool is gathering schema information; this process may
take some time.  Enable the org.apache.openjpa.jdbc.Schema logging category
to see messages about schema data.
1436  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 20201168, conn 17298525>
executing prepstmnt 14982605 SELECT NULL AS SEQUENCE_SCHEMA, relname AS
SEQUENCE_NAME FROM pg_class WHERE relkind='S'
1439  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 20201168, conn 17298525>
[3 ms] spent
2750  parkPU  INFO   [main] openjpa.Tool - ReverseMappingTool : generating
classes.
2751  parkPU  INFO   [main] openjpa.Tool - Writing generated class source
code.
2852  parkPU  INFO   [main] openjpa.Tool - Writing generated metadata.
gilberto@SUGEP-DMASI:~/dev/netbeans-config/park-jpa/core>         

Gilberto


gilbertoca wrote:
> 
> Hi,
> 
> I'm trying to generate may orm.xml file from Database, but ...:
> 
> gilberto@SUGEP-DMASI:~/dev/netbeans-config/park-jpa/core> java -cp
> /home/gilberto/.m2/repository/postgresql/postgresql/8.3-603.jdbc3/postgresql-8.3-603.jdbc3.jar:/home/gilberto/.m2/repository/org/apache/openjpa/openjpa-all/2.0.0-M3/openjpa-all-2.0.0-M3.jar
> org.apache.openjpa.jdbc.meta.ReverseMappingTool -d src/ -p
> target/classes/META-INF/persistence.xml
> 28  parkPU  INFO   [main] openjpa.Tool - The reverse mapping tool will run
> on the database.  The tool is gathering schema information; this process
> may take some time.  Enable the org.apache.openjpa.jdbc.Schema logging
> category to see messages about schema data.
> 1343  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 9045316, conn 23053324>
> executing prepstmnt 14293164 SELECT SEQUENCE_SCHEMA, SEQUENCE_NAME FROM
> INFORMATION_SCHEMA.SEQUENCES
> 1347  parkPU  TRACE  [main] openjpa.jdbc.SQL - <t 9045316, conn 23053324>
> [4 ms] spent
> Exception in thread "main" java.lang.NullPointerException
>         at org.postgresql.core.Utils.appendEscapedLiteral(Utils.java:80)
>         at
> org.postgresql.jdbc2.AbstractJdbc2Connection.escapeString(AbstractJdbc2Connection.java:939)
>         at
> org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.escapeQuotes(AbstractJdbc2DatabaseMetaData.java:1573)
>         at
> org.postgresql.jdbc2.AbstractJdbc2DatabaseMetaData.getIndexInfo(AbstractJdbc2DatabaseMetaData.java:3836)
>         at
> org.apache.openjpa.lib.jdbc.DelegatingDatabaseMetaData.getIndexInfo(DelegatingDatabaseMetaData.java:207)
>         at
> org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingDatabaseMetaData.getIndexInfo(LoggingConnectionDecorator.java:788)
>         at
> org.apache.openjpa.lib.jdbc.DelegatingDatabaseMetaData.getIndexInfo(DelegatingDatabaseMetaData.java:207)
>         at
> org.apache.openjpa.jdbc.sql.DBDictionary.getIndexInfo(DBDictionary.java:4049)
>         at
> org.apache.openjpa.jdbc.schema.SchemaGenerator.generateIndexes(SchemaGenerator.java:650)
>         at
> org.apache.openjpa.jdbc.schema.SchemaGenerator.generateIndexes(SchemaGenerator.java:399)
>         at
> org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:276)
>         at
> org.apache.openjpa.jdbc.schema.SchemaGenerator.generateSchemas(SchemaGenerator.java:243)
>         at
> org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:1974)
>         at
> org.apache.openjpa.jdbc.meta.ReverseMappingTool.run(ReverseMappingTool.java:1958)
>         at
> org.apache.openjpa.jdbc.meta.ReverseMappingTool$1.run(ReverseMappingTool.java:1829)
>         at
> org.apache.openjpa.lib.conf.Configurations.launchRunnable(Configurations.java:723)
>         at
> org.apache.openjpa.lib.conf.Configurations.runAgainstAllAnchors(Configurations.java:713)
>         at
> org.apache.openjpa.jdbc.meta.ReverseMappingTool.main(ReverseMappingTool.java:1824)
> gilberto@SUGEP-DMASI:~/dev/netbeans-config/park-jpa/core>                        
     
> 
> Do I need to pass anymore option to it (ReverseMappingTool)?
> 
> Thanks,
> 
> Gilberto
> 
> 

-- 
View this message in context: http://n2.nabble.com/ReverseMappingTool-generate-orm-xml-from-Database-schema-tp4261755p4261957.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message