One possibility is to define a View at database level containing all the
fields you want and map that to a JPA entity. But I agree it could be argued
that this is also a form of duplication.
> -----Original Message-----
> From: Futaleufu_John [mailto:
jhalupka@...]
> Sent: Friday, 3 October 2008 9:34 PM
> To:
nbusers@...
> Subject: [nbusers] Displaying related data from JPA query in JSF table
> component
>
>
> I have an existing web app built using J2EE 1.4, JSF 1.1, MySQL and Tomcat
> 6.
> The DB has 40 tables with lots of links between tables. The DB will soon
> grow to 60+ tables with even more links.
>
> The current web app works fine - it's been up for almost a year - but
> managing inserts, updates and deletes is getting more and more
> complicated.
>
> I'd like to migrate from data providers to JPA. So far I like what I've
> seen
> of JPA but I'm still evaluating it.
>
> One problem is that the web app uses lots of table components that display
> information from related DB tables. That's easy to do with data providers.
> Not so easy to do with JPA, as far as I can tell.
>
> Simple example:
>
> I have a contact table whose fields are FKs to company (company name,
> website), address (address1, address2, city, state, zip code), and person
> (first name, last name, email) tables. I can execute a JPA query to get
> the
> contacts I want. I can bind the results to a table component. But I can't
> display any properties of the company, address or person objects. Winston
> suggested adding getters to the contact POJO, but that seems to be
> duplicating what's already there.
>
> Does anyone have another way to solve this problem?
> --
> View this message in context:
http://www.nabble.com/Displaying-related-> data-from-JPA-query-in-JSF-table-component-tp19797848p19797848.html
> Sent from the Netbeans - Users mailing list archive at Nabble.com.