org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] Error Code: 22018 Call: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) bind => [1, 2] Query: ReadAllQuery(referenceClass=RoleEntity sql="SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN (?))")

Spring JIRA | Igor Mukhin | 4 months ago
  1. 0

    Calling {code} roleRepository.findAll(Arrays.asList(1, 2)); {code} results in {code} Caused by: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] Error Code: 22018 Call: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) bind => [1, 2] Query: ReadAllQuery(referenceClass=RoleEntity sql="SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN (?))") at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:684) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:560) at org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2056) at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299) at org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2740) at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2693) at org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:559) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1175) at org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904) at org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1134) at org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:460) at org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1222) at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839) at org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804) at org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258) ... 59 more Caused by: org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] at org.h2.message.DbException.getJdbcSQLException(DbException.java:345) at org.h2.message.DbException.get(DbException.java:168) at org.h2.value.Value.convertTo(Value.java:1011) at org.h2.mvstore.db.MVSecondaryIndex.convertToKey(MVSecondaryIndex.java:322) at org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:258) at org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:254) at org.h2.index.BaseIndex.find(BaseIndex.java:128) at org.h2.index.IndexCursor.find(IndexCursor.java:169) at org.h2.table.TableFilter.next(TableFilter.java:466) at org.h2.command.dml.Select.queryFlat(Select.java:541) at org.h2.command.dml.Select.queryWithoutCache(Select.java:654) at org.h2.command.dml.Query.query(Query.java:341) at org.h2.command.dml.Query.query(Query.java:309) at org.h2.command.dml.Query.query(Query.java:36) at org.h2.command.CommandContainer.query(CommandContainer.java:110) at org.h2.command.Command.executeQuery(Command.java:201) at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:110) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1009) at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644) ... 79 more Caused by: java.lang.NumberFormatException at java.math.BigDecimal.<init>(BigDecimal.java:494) at java.math.BigDecimal.<init>(BigDecimal.java:383) at java.math.BigDecimal.<init>(BigDecimal.java:806) at org.h2.value.Value.convertTo(Value.java:961) ... 95 more {code} The same exception is thrown if you try to declare the following repository method: {code} List<RoleEntity> findByIdIsIn(List<Integer> ids); {code} The problem is with Spring Data building the query. EclipseLink expects {{e.id IN ?}} but String Data does {{e.id IN ((?, ?))}}, which itself is incorrect as it should be {{e.id IN (?, ?)}} (only one pair of parenthesis). --------------- Current workaround is: {code} @Query("select r from RoleEntity r where r.id in :ids") List<RoleEntity> findByIds(@Param("ids") List<Integer> ids); {code}

    Spring JIRA | 4 months ago | Igor Mukhin
    org.h2.jdbc.JdbcSQLException: Datenumwandlungsfehler beim Umwandeln von "(1, 2)" Data conversion error converting "(1, 2)"; SQL statement: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) [22018-192] Error Code: 22018 Call: SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN ((?,?))) bind => [1, 2] Query: ReadAllQuery(referenceClass=RoleEntity sql="SELECT ID, NAME FROM PBT_ROLE WHERE (ID IN (?))")
  2. 0

    org.h2.jdbc.JdbcSQLException: Data conversion error converting "2016-11-15 10:15:07.063"

    GitHub | 3 weeks ago | aunlu
    javax.persistence.PersistenceException: org.hibernate.exception.DataException: could not extract ResultSet
  3. 0

    NumberFormatException

    GitHub | 3 years ago | leventov
    java.lang.NumberFormatException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    GitHub comment 447#190843781

    GitHub | 9 months ago | aleshkanet
    java.lang.Exception: §4Этого набора не существует или не определены настройки.

  1. marcbouvierdav 1 times, last 2 months ago
  2. Jaytee 7 times, last 6 months ago
16 unregistered visitors
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. java.lang.NumberFormatException

    No message provided

    at java.math.BigDecimal.<init>()
  2. Java RT
    BigDecimal.<init>
    1. java.math.BigDecimal.<init>(BigDecimal.java:494)
    2. java.math.BigDecimal.<init>(BigDecimal.java:383)
    3. java.math.BigDecimal.<init>(BigDecimal.java:806)
    3 frames
  3. H2 Database Engine
    JdbcPreparedStatement.executeQuery
    1. org.h2.value.Value.convertTo(Value.java:961)
    2. org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
    3. org.h2.message.DbException.get(DbException.java:168)
    4. org.h2.value.Value.convertTo(Value.java:1011)
    5. org.h2.mvstore.db.MVSecondaryIndex.convertToKey(MVSecondaryIndex.java:322)
    6. org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:258)
    7. org.h2.mvstore.db.MVSecondaryIndex.find(MVSecondaryIndex.java:254)
    8. org.h2.index.BaseIndex.find(BaseIndex.java:128)
    9. org.h2.index.IndexCursor.find(IndexCursor.java:169)
    10. org.h2.table.TableFilter.next(TableFilter.java:466)
    11. org.h2.command.dml.Select.queryFlat(Select.java:541)
    12. org.h2.command.dml.Select.queryWithoutCache(Select.java:654)
    13. org.h2.command.dml.Query.query(Query.java:341)
    14. org.h2.command.dml.Query.query(Query.java:309)
    15. org.h2.command.dml.Query.query(Query.java:36)
    16. org.h2.command.CommandContainer.query(CommandContainer.java:110)
    17. org.h2.command.Command.executeQuery(Command.java:201)
    18. org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:110)
    18 frames
  4. EclipseLink (non-OSGi)
    QueryImpl.executeReadQuery
    1. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:1009)
    2. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:644)
    3. org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:340)
    4. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:684)
    5. org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:560)
    6. org.eclipse.persistence.internal.sessions.AbstractSession.basicExecuteCall(AbstractSession.java:2056)
    7. org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:570)
    8. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:242)
    9. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:228)
    10. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:299)
    11. org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:694)
    12. org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2740)
    13. org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2693)
    14. org.eclipse.persistence.queries.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:559)
    15. org.eclipse.persistence.queries.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:1175)
    16. org.eclipse.persistence.queries.DatabaseQuery.execute(DatabaseQuery.java:904)
    17. org.eclipse.persistence.queries.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:1134)
    18. org.eclipse.persistence.queries.ReadAllQuery.execute(ReadAllQuery.java:460)
    19. org.eclipse.persistence.queries.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:1222)
    20. org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2896)
    21. org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1857)
    22. org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1839)
    23. org.eclipse.persistence.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1804)
    24. org.eclipse.persistence.internal.jpa.QueryImpl.executeReadQuery(QueryImpl.java:258)
    24 frames