How to point to other table's ID with hibernate?

Posted by Wilhelm on Stack Overflow See other posts from Stack Overflow or by Wilhelm
Published on 2010-03-12T23:26:53Z Indexed on 2010/03/12 23:27 UTC
Read the original article Hit count: 235

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about java