Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface EventObjectRepository extends CrudRepository<EventObject, Long> {
- @Query(value = "select tb.content from table0 tb where tb.id=:id", nativeQuery = true)
- List<String> find(@Param("id") Long id);
- }
- [clob1: '{"identity":0,"original_text":"some text","rowid":2}', clob2: '{"identity":2,"original_text":"some text","rowid":3}', clob3: '{"identity":3,"original_text":"some text","rowid":4}', clob4: '{"identity":4,"product.name":"some name","original_text":"some text","commodity.name":"some name","rowid":5}']
- results.get(1)
- [ERROR] 2018-10-22 13:44:45.113 [http-nio-8090-exec-1] [dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.Cla
- ssCastException: com.sun.proxy.$Proxy164 cannot be cast to java.lang.String] with root cause
- java.lang.ClassCastException: com.sun.proxy.$Proxy164 cannot be cast to java.lang.String
- @Column(columnDefinition="text")
- @Lob
- private String content;
- public interface EventObjectRepository extends CrudRepository<EventObject, Long> {
- @Query(value = "select tb.content from table0 tb where tb.id=:id", nativeQuery = true)
- List<Clob> find(@Param("id") Long id);
- }
- InputStream stream = results.get(1).getAsciiStream();
- StringWriter w = new StringWriter();
- IOUtils.copy(stream, w);
- String clobAsString = w.toString();
Add Comment
Please, Sign In to add comment