openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.org>
Subject using openjpa.jdbc.Schema=DEV
Date Tue, 08 Jan 2008 21:07:34 GMT
OpenJPA is unable to see tables in queries.

I have specified the property as in the email title and used the <schema> tag in 
the mapping files and/or the persistence-unit-defaults.

I thought this might be linked to a bug in v1.1.0-SNAPSHOT but I didn't manage 
to make it work in 1.0.1 either.

Throughout the logging, I see that OpenJPA finds the tables and from debugging I 
can see that the schema name is available, but it's not compiling the SQL 
statement with it!

Some of the logging:

DEBUG openjpa.Runtime.trace() - Properties: openjpa.EntityManagerFactory: default
openjpa.jdbc.Schema: DEV
....

DEBUG openjpa.jdbc.Schema.trace() - Reading table information for schema name 
"DEV", table name "CODE".
DEBUG openjpa.jdbc.JDBC.trace() - <t 25174220, conn 24699199> getColumns: null, 
DEV, CODE, null
DEBUG openjpa.jdbc.Schema.trace() - Reading column information for table "DEV.CODE".
DEBUG openjpa.jdbc.Schema.trace() - Found existing column "ID" on table "DEV.CODE".
.....

<openjpa-1.1.0-SNAPSHOT-rexported nonfatal general error>

java.sql.SQLException: Table not found in statement [SELECT LIMIT 0 1 t0.ID, 
t0.CODE_TYPE_ID, t0.CONTENT, t0.OWNER_ID, t0.TITLE FROM CODE t0 ORDER BY 1]
	at org.hsqldb.jdbc.Util.throwError(Unknown Source)
	at org.hsqldb.jdbc.jdbcPreparedStatement.<init>(Unknown Source)
	at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
	at 
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:166)
	at 
org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection.prepareStatement(LoggingConnectionDecorator.java:225)
	at 
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:164)
	at 
org.apache.openjpa.lib.jdbc.ConfiguringConnectionDecorator$ConfiguringConnection.prepareStatement(ConfiguringConnectionDecorator.java:140)
	at 
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:164)
	at 
org.apache.openjpa.jdbc.kernel.JDBCStoreManager$RefCountConnection.prepareStatement(JDBCStoreManager.java:1316)
	at 
org.apache.openjpa.lib.jdbc.DelegatingConnection.prepareStatement(DelegatingConnection.java:153)
	at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:475)
	at org.apache.openjpa.jdbc.sql.SQLBuffer.prepareStatement(SQLBuffer.java:455)
	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:354)
	at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:318)
	at 
org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
	at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
	at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1222)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:989)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:804)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:774)
	at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:770)
	at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:517)
	at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:238)
	at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:277)
	at 
org.permacode.BaseJpaIntegrationTest.getFirstObjectInQuery(BaseJpaIntegrationTest.java:490)
	at 
org.permacode.BaseJpaIntegrationTest.getFirstObjectInQuery(BaseJpaIntegrationTest.java:466)
	at 
org.permacode.patternrepo.jpa.JpaIntegrationEnumerationUpdateTest.testUpdate(JpaIntegrationEnumerationUpdateTest.java:74)


Mime
View raw message