java - Read image stored as blob, directly into byte[] using springdata -


i have image stored in oracle database , i'm using spring data retrieve image.

@query("select c.binarycontent contententity c join c.parentcontententities pce pce.specificentity.id = :id , pce.contenttype.id = 11") byte [] getimagebinarycontent(@param("id") long id);   @lob @column(name = "binary_content") private byte [] binarycontent;   byte[] testimagearray = servicelayer.getimagebinarycontent(id) returns null 

tested individually query works. finds content when call made getimagebinarycontent passing in id, nothing back, null result. if change return type blob, blob back.

why can't read blob byte array directly? searches have shown examples of getting blob returned, , converting blob inputstream byte array, seems should able directly.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -