I'm not sure, but I don't know if using BLOB (I suppose is a SQL type class) as bean property is the right way.
Maybe you can try changing it by:
@Lob @Basic(fetch = FetchType.LAZY) byte contents = null;
@Lob @Basic(fetch = FetchType.LAZY) InputStrem contents = null;
i modified the code as you suggested but nothing new happened.
The problem is that i cannot have hibernate to skip the blob column in the generated sql.
mmm..... it seems a so easy issue to solve...
Ask this stuff in the Hibernate forums.
I had this problem yesterday. I'm using postgresql and defined the field like:
byte contents = null;
This create a bytea (similar to a blob) field in the database. If I annotated it with @Lob then a uid field is created. and contents is stored in a different location in the database. I believe that either ways works and there are pro and cons to using either a bytea or uid. I personally just went with the bytea.
I also had problems getting lazy fetching to work. In order to get lazy fetching to work you have to "instrument' your class files. This involves running an ant task on your compiled .class file. The easier and possibly better way is to use a query that does a "select new". That way you don't have to instrument your class files. For your class you would do a query like
select new File(f.person,f.filename) from File f
The above query only loads the person and filename fields. In order to get it to work you need to have 2 constructors in your class. The regular no args one and the constructor that takes a person and filename which is called by the above query. The downside to this method is that it is read only. You can't make modifications to the File object loaded with a select new and then write it to the database.
thank you very much, it helped me a lot for the moment.