java - Mapping entities with composite keys -


i working on converting legacy system use hibernate (version 3.3.x) instead of using hand crafted sql. have run in problems mapping datamodel pertians composite keys. i've created solution think works, not overly fond of it. hence, see how diagram below could/should mapped , see if on "right" track.

alt text

in diagram stufftypes pretty static table don't change (no inserts or updates). parent table has dao class associated (the others should persisted when parent instance is). stuff has stufftype , number of substuff associated it. finally, substuff many many mapping table between stuff , stufftypes.

what best way of mapping these entities java objects using annotations?

personally, refer section 3.2 primary keys through -toone relationships of jpa wiki book. , read 3.1 composite primary keys.


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -