Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the alternate for deprecated Hibernate.createClob(Reader reader, int length)

Seems like Hibernate.createClob(Reader reader, int length) is deprecated in version 3.6.x And it suggests to use Use LobHelper.createClob(Reader, long) instead.

But LobHelper is an interface not a class.

Is there any alternate for static method Hibernate.createClob(Reader reader, int length)?

like image 546
Ashraf Avatar asked Dec 27 '22 06:12

Ashraf


1 Answers

I was using the createBlob(bytes[]) from that class. I created a new class and the following method

    public static Blob createBlob(byte[] bytes) {
       return NonContextualLobCreator.INSTANCE.wrap(NonContextualLobCreator.INSTANCE.createBlob(bytes));
    }
like image 127
dhernandez Avatar answered Dec 30 '22 10:12

dhernandez