my dog learned polymorphism
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes JPQL: iterator on several entities Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "JPQL: iterator on several entities" Watch "JPQL: iterator on several entities" New topic

JPQL: iterator on several entities

Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 549

I have a little question about JPQL, I am trying to find the best way to do it.

I want to iterate on a list made of 3 entities :

I have not looked precisely yet, but what does resultats contain exactly in that case ?

{((Catalogue1), (Product1), (Article1)), ((Catalogue2), (Product2), (Article2)), � } ???

I want to produce the following table :

Name of Catalogue � Name of Product � Name of Article
nameCat1 nameProd1 nameArt1
nameCat2 nameProd2 nameArt2
nameCat3 nameProd3 nameArt3

nameCatalogue : Catalogue.getName() �
nameProduct : Product.getName() �
nameArticle : Article.getName() �

[ November 05, 2008: Message edited by: Celinio Fernandes ]

SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
Tomaszz Lewandowski
Ranch Hand

Joined: Sep 07, 2007
Posts: 30

It will be a List of Object[]. First element will be Catalogue instance, second element - Product instance, third element - Article instance.

Regards<br />Tomasz Lewandowski<br />SCJP5 (97%) | SCWCD5 (98%)
I agree. Here's the link:
subject: JPQL: iterator on several entities
It's not a secret anymore!