What data type does ebean map to BYTEA?
问题 I have a Play! 2.0.2 application that needs to store some files in the database. we are using Ebean for our ORM. I believe I need a BYTEA column in my database to store the file, but I'm not sure what data type to use in my model. Should I be using some kind of Blob ? Or just a byte[] ? Or is there another data type I should be using? Thanks! 回答1: To create blob with Ebean you need to use byte array with @Lob annotation @Lob public byte[] image; You'll need to convert between File <-> byte