Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inner Join of entity objects

 
Greivin Sanchez
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Greenhorn
Posts: 6
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic