org.postgresql.util.PSQLException: The column index is out of range: 5, number of columns: 4.

Stack Overflow | mateusz | 6 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Hibernate, Spring, PostgreSQL - column index is out of range

    Stack Overflow | 6 months ago | mateusz
    org.postgresql.util.PSQLException: The column index is out of range: 5, number of columns: 4.

    Root Cause Analysis

    1. org.postgresql.util.PSQLException

      The column index is out of range: 5, number of columns: 4.

      at org.postgresql.core.v3.SimpleParameterList.bind()
    2. PostgreSQL JDBC Driver
      SimpleParameterList.setNull
      1. org.postgresql.core.v3.SimpleParameterList.bind(SimpleParameterList.java:68)[postgresql-9.4.1211.jar:9.4.1211]
      2. org.postgresql.core.v3.SimpleParameterList.setNull(SimpleParameterList.java:157)[postgresql-9.4.1211.jar:9.4.1211]
      2 frames
    3. org.postgresql.jdbc
      PgPreparedStatement.setNull
      1. org.postgresql.jdbc.PgPreparedStatement.setNull(PgPreparedStatement.java:287)[postgresql-9.4.1211.jar:9.4.1211]
      1 frame
    4. Hibernate
      ActionQueue.executeActions
      1. org.hibernate.type.descriptor.sql.BasicBinder.bind(BasicBinder.java:61)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      2. org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:257)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      3. org.hibernate.type.AbstractStandardBasicType.nullSafeSet(AbstractStandardBasicType.java:252)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      4. org.hibernate.type.ComponentType.nullSafeSet(ComponentType.java:343)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      5. org.hibernate.persister.entity.AbstractEntityPersister.dehydrateId(AbstractEntityPersister.java:2636)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      6. org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:2604)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      7. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2883)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      8. org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3386)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      9. org.hibernate.action.internal.EntityInsertAction.execute(EntityInsertAction.java:89)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      10. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:560)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      11. org.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:434)[hibernate-core-5.0.9.Final.jar:5.0.9.Final]
      11 frames