How Do Hibernate Composite Keys Affect Property Access?
This is a high level question that I haven't been able to wrap my google abilities around.
I've got an Access table that maps rights to pieces of data to users. The table contains an id for the user, an id for the data, and a code for the right. According to the schema these three fields make up the primary key.
I will likely be accessing the data from a set from either the user or the data and will not likely have to grab any of the AccessControlLists myself. After the set operation, I'm only interested in the pairs that come out (either {user,right} or {data,right}).
Normally I'd make a composite id, but then I'd have to go through extra effort every time I wanted to get these two simple fields.
Am I able to specify these fields as properties as well? Or can someone think of a way that I could continue to provide simple access to these fields that开发者_开发知识库 may by part of a composite-id.
Edit: I'm working under the possibly incorrect assumptions that:
- I need a hibernate ID for every table
- I cannot have a column be both a property and an id
精彩评论