I am trying to switch from Hibernate to EclipseLink. Now I am faced with the problem of creating a BLOB. With Hibernate, I solved it like this:
import org.hibernate.LobHelper; import org.hibernate.classic.Session; ... public Blob createBlob(InputStream inputStream, long length) { Session session = entityManager.unwrap(Session.class); LobHelper lobHelper = session.getLobHelper(); Blob blob = lobHelper.createBlob(inputStream, length); return blob; }
Any hints how can I do this with EclipseLink? (I am in Oracle DB).
Johnny
source share