• Post Reply Bookmark Topic Watch Topic
  • New Topic

Datatable: Link foreign keys to actual data  RSS feed

 
Samson Mlati
Ranch Hand
Posts: 41
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!