Add mapper from bytea to BLOB
See original GitHub issueI have column byteea in postgres table speedment coverts to Optional
<Blob>
When I stream data i get error
com.speedment.runtime.core.exception.SpeedmentException: org.postgresql.util.PSQLException: Bad value for type long : \x230d0a23546875204665622030382031383a35353a323720474d5420323031380d0a6d794b65793d6d7956616c75650d0a
Full stack trace
2018-02-17T12:57:28.227Z ERROR [main] (c.s.r.c.i.s.b.AbstractStreamBuilder) - org.postgresql.util.PSQLException: Bad value for type long : \x230d0a23546875204665622030382031383a35353a323720474d5420323031380d0a6d794b65793d6d7956616c75650d0a
com.speedment.runtime.core.exception.SpeedmentException: org.postgresql.util.PSQLException: Bad value for type long : \x230d0a23546875204665622030382031383a35353a323720474d5420323031380d0a6d794b65793d6d7956616c75650d0a
at com.company.public_.scheduledemo.public_.qrtz_job_details.generated.GeneratedQrtzJobDetailsSqlAdapter.apply(GeneratedQrtzJobDetailsSqlAdapter.java:56)
at com.speedment.runtime.core.internal.stream.StreamUtil$ResultSetIterator.forEachRemaining(StreamUtil.java:196)
at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580)
at com.speedment.runtime.core.internal.component.sql.override.def.reference.DefaultForEachTerminator.apply(DefaultForEachTerminator.java:47)
at com.speedment.runtime.core.internal.manager.sql.SqlStreamTerminator.forEach(SqlStreamTerminator.java:101)
at com.speedment.runtime.core.internal.stream.builder.ReferenceStreamBuilder.lambda$forEach$0(ReferenceStreamBuilder.java:165)
at com.speedment.runtime.core.internal.stream.builder.AbstractStreamBuilder.finallyClose(AbstractStreamBuilder.java:178)
at com.speedment.runtime.core.internal.stream.builder.ReferenceStreamBuilder.forEach(ReferenceStreamBuilder.java:165)
at com.company.public_.Test.main(Test.java:18)
Caused by: org.postgresql.util.PSQLException: Bad value for type long : \x230d0a23546875204665622030382031383a35353a323720474d5420323031380d0a6d794b65793d6d7956616c75650d0a
at org.postgresql.jdbc.PgResultSet.toLong(PgResultSet.java:2859)
at org.postgresql.jdbc.PgResultSet.getLong(PgResultSet.java:2113)
at org.postgresql.jdbc.PgResultSet.getBlob(PgResultSet.java:417)
at com.company.public_.scheduledemo.public_.qrtz_job_details.generated.GeneratedQrtzJobDetailsSqlAdapter.apply(GeneratedQrtzJobDetailsSqlAdapter.java:54)
... 9 more
Process finished with exit code 1
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Force Liquibase to map Blob to BYTEA on PostgreSQL
For liquibase 3.4, I didn't have to to do this. I just put the column type as BLOB and then liquibase would generate...
Read more >how mybatis insert/delete blob, large object, bytea columns in ...
Hello,. Is there an online doc about how mybatis deal with(add, update, remove) large object (postgresql8.3)?. <insert id="" parameterType="?" >
Read more >Hibernate Binary Data and BLOB Mapping Example
This tutorial shows you how to map byte array (byte[]) or Binary Large Object (java.sql.Blob) of Java type to database type using Hibernate ......
Read more >postgres: Read blob/bytea as stream via LargeObject api #1706
I tried using mapTo(InputStream.class) and mapTo(Blob.class) , but both failed with a NoSuchMapperException . It seems to work with mapTo ...
Read more >Programmatically inserting images as binary data (BLOB) in ...
I have added another field of bytea type, named img_blob, to the table and configured the attribute form in such a way that, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you, as you pointed out it’s the job_data column that causes the error. Currently, Speedment doesn’t support the mapping of a bytea to a
Blob
.There are a few possible options to work around this issue:
TypeMapper
from bytea toBlob
.Blob
type.OK thanks . I’ll update it.