views:

142

answers:

1

Hi, I would like to know if there is any way I can store a fileAttachment directly into the database with JPA.

I have an attribute:

public fileAttachement logo;

I have tried to change it to:

@Lob
public byte[] logo;

But that's not doing what I was expecting.

A: 

And a "fileAttachment" is what exactly ? class definition ? DataNucleus provides a flexible way of persisting any type as a String, so depending on your "fileAttachment" you could use that

DataNucleus
This is the api page for fileAttachment : http://www.playframework.org/@api/play/db/jpa/FileAttachment.html
mnml
I have had a look at DataNucleus it seems good but I'd rather store my data as Blob.
mnml