Meaningless Drivel is fun!
The moose likes JSF and the fly likes Inner Join of entity objects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Inner Join of entity objects" Watch "Inner Join of entity objects" New topic

Inner Join of entity objects

Greivin Sanchez

Joined: Jan 21, 2011
Posts: 2
I created a CRUD JSF proyect in Netbeans. I first created the Entity Classes from Database, then i created the JSF pages from the Entity Classes. There are two tables in the database, Table A and Table B. Table B references table A.

In my application I have a datatable of Table A and i want to be able to drill down on a row that will take me to the datatable of table B but only showing the values that references the row of table A that was selected. I have created the the page that shows the data from table A and the drill down that takes me to the page of table B, but i have not been able to show only the data from Table B that references the item selected in Table A. I am completely lost with this. Does anyone know of any tutorial that could help me or knows how to solve this problem? I would appreciate it tremendously.

Thanks in advance
Don Esteban Cerrojo

Joined: Jan 21, 2011
Posts: 4
And I'm lost with your Question Perhaps You can show us some sample code to specify your problem. It seem to me more like a database question than JSF. Are You talking about a 1:n relationship and/or master-/detail-forms?
Greivin Sanchez

Joined: Jan 21, 2011
Posts: 2
It is not a database problem. When I click on the first table I need to be redirected to another page but only showing the attributes that refer to that table. I am not good explaining things so I am going to give an example.
Table A has the following attributes Aid, Name, Last_Name. Table B has the following attributes Bid, Tasks, Aid(FK, references table A). When I click on a row in Table A it needs to take me to another page where the data in Table B is shown, but only showing the data that references the row clicked in table a.
Aba Dov

Joined: Jan 24, 2011
Posts: 6


You can solve this by passing Table B fk while to the server when pressing on the jsf table;
You can also query all the data and decide what to display according to the table row clicked.
Please post the code.
wood burning stoves
subject: Inner Join of entity objects
It's not a secret anymore!