org.postgresql.util.PSQLException: The column name FKTABLE_SCHEM not found.

Oracle Community | 3004 | 1 decade ago
  1. 0

    Kodo 3.0.1 and Postgres 7.4

    Oracle Community | 1 decade ago | 3004
    org.postgresql.util.PSQLException: The column name FKTABLE_SCHEM not found.
  2. 0

    The column name <col> was not found in this ResultSet

    Google Groups | 4 years ago | Zsolt Kúti
    org.postgresql.util.PSQLException: The column name o.id was not found
  3. 0

    how to manipulate resultset

    Stack Overflow | 3 years ago | user3610984
    org.postgresql.util.PSQLException: The column name location not found.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This entity: {code} @Entity @Table(name = "`TestEntities`") public class TestEntity { @Id @Column(name = "`id`", nullable = false, updatable = false) @GeneratedValue(strategy = GenerationType.IDENTITY) private long id; @Column(name = "`foo`", nullable = true) private String foo; public TestEntity() { } public void setFoo(String foo) { this.foo = foo; } } {code} With this test: {code} @Test public void save() { EntityManager entityManager = daoTestHelper.getEntityManagerFactory() .createEntityManager(); try { // Create the entity to try saving. TestEntity testA = new TestEntity(); testA.setFoo("bar"); // Try to save the entity. EntityTransaction tx = entityManager.getTransaction(); try { tx.begin(); entityManager.persist(testA); tx.commit(); } finally { if (tx.isActive()) tx.rollback(); } } finally { entityManager.close(); } } {code} Fails with this error on PostgreSQL 9.1: {code} javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [com.justdavis.karl.rpstourney.service.api.auth.game.TestEntity] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1763) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1677) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1683) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1187) at com.justdavis.karl.rpstourney.service.app.auth.game.TestEntitiesIT.save(TestEntitiesIT.java:108) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.junit.runners.Suite.runChild(Suite.java:127) at org.junit.runners.Suite.runChild(Suite.java:26) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: org.hibernate.exception.SQLGrammarException: could not insert: [com.justdavis.karl.rpstourney.service.api.auth.game.TestEntity] at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:65) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3032) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3558) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:98) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:490) at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:195) at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:179) at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:214) at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:324) at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:288) at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:194) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125) at org.hibernate.jpa.event.internal.core.JpaPersistEventListener.saveWithGeneratedId(JpaPersistEventListener.java:84) at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:206) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:149) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:75) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:811) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:784) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:789) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:1181) ... 34 more Caused by: org.postgresql.util.PSQLException: The column name "id" was not found in this ResultSet. at org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2727) at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getLong(AbstractJdbc2ResultSet.java:2593) at org.hibernate.id.IdentifierGeneratorHelper.get(IdentifierGeneratorHelper.java:150) at org.hibernate.id.IdentifierGeneratorHelper.getGeneratedIdentity(IdentifierGeneratorHelper.java:93) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:100) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:58) ... 53 more {code} Interestingly, it works if {{TestEntity}} has only just the {{id}} column. As soon as I add another column, e.g. {{foo}}, it fails.

    Hibernate JIRA | 2 years ago | Karl M. Davis
    javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not insert: [com.justdavis.karl.rpstourney.service.api.auth.game.TestEntity]

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.postgresql.util.PSQLException

      The column name FKTABLE_SCHEM not found.

      at kodo.jdbc.sql.SQLExceptions.getFatalDataStore()
    2. kodo.jdbc.sql
      SQLExceptions.getFatalDataStore
      1. kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:42)
      2. kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:24)
      2 frames
    3. kodo.jdbc.schema
      LazySchemaFactory.findTable
      1. kodo.jdbc.schema.LazySchemaFactory.findTable(LazySchemaFactory.java:150)
      1 frame
    4. kodo.jdbc.meta
      BaseClassMapping.fromMappingInfo
      1. kodo.jdbc.meta.BaseClassMapping.fromMappingInfo(BaseClassMapping.java:148)
      1 frame