File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Datatable: Link foreign keys to actual data Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Datatable: Link foreign keys to actual data" Watch "Datatable: Link foreign keys to actual data" New topic
Author

Datatable: Link foreign keys to actual data

Samson Mlati
Ranch Hand

Joined: Feb 23, 2009
Posts: 41

I have a datatable whose source is a table with some foreign keys in it. I would like to replace the foreign keys with a an entry from a column in the related table. Is there an easy way to do this?


Best,
Mlati
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14456
    
    7

One of the easiest to code (though not to setup) is to use an ORM. In that case, you can simply refer to embedded object properties. For example:


Where the Object Model for invoice replaces the explicit foreign key with the object represented by the foreign key. But it does require that you ensure that the header object is loaded in time, since the default on most ORMs is lazy fetching. That's not all that hard to do, though.

Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: jrebel
 
subject: Datatable: Link foreign keys to actual data
 
Similar Threads
What effects by using a lot of foreign keys?
How to make relations inside between mysql database tables
turn on / off db constraints -
Can we make any column in nested table as foreign key of a normal table primary key?
JSF datatable with dynamic columns