How to point to other table's ID with hibernate?
- by Wilhelm
The problem: let's say I have two tables Client, and Product, in which Client has its primary key and a column called products (that points to pk's in Product table)... ok, if I need products to point only one row, it's nice, but if I need it to point for... 1000 rows in Product table, the products column would have to be larger enought... but I can't predict this situation.
So, how could I design my table and how would I use hibernate with it, to achieve that "pointing" in a optmized and maybe "easy" way.
NOTE: I excluded some columns of the "design" presented here, just to keep the simplicity.