I have a question regarding the result transformer and mapping of an array.
(ex). I have a view that returns records as below. id Image --------------- 1 Blob1 1 Blob2 2 Blob3
I have a java object that has the id and Image. The image atrribute is defined as an array of blobs. In the above case, I want hibernate to return me two objects. The first one with an id - 1 and images array containing 2 blobs and the second object with id - 2 with one blob in the array.
I am using Criteria API and applying the DISTINCT_ROOT_ENTITY transformer.
I would like to know if retrieving the results as per the above requirement possible in Hibernate?If so, how should the hbm mapping for images blob array look like?
Thanks in advance.
|