I have tried changing java.util.Set
to java.util.List
but doing so requires too many changes to the application which is a pain.
Instead, I have turned java.util.Set
into an array using its toArray()
method and it worked.
<p:carousel id="carousel" value="#{row.productSet.toArray()}" var="prodRow" numVisible="6" headerText="#{row.subCatName}">
<!--<h:outputText value="#{prodRow.prodId}"/>-->
<p:graphicImage library="fileUpload" name="product_image/medium/#{prodRow.productImageSet.toArray()[0].prodImage}" alt="#{prodRow.prodName}" height="140" width="135"/>
</p:carousel>
I have replaced <h:outputText>
with <p:graphicImage>
for a concrete requirement for displaying images on <p:graphicImage>
.
I don't know whether the problem has to do with the JPA provider EclipseLink itself or java.util.Set
. If someone knows, please clarify.
EDIT:
I have now changed every inverse (or mapped by) field from java.util.Set
to java.util.List
everywhere in my application and it works just fine. There is no need to use .toArray()
as have to be used with java.util.Set
.