I need to create a table that is similar to a many-to-many mapping for "resources" and "systems". Each resource will be mapped to 0 or more systems on which it can run. Each system will be mapped to 0 or more resources that are configured to run on it.
The twist to this is that I would like to map the state of each resource on each system. So, I want a table like this:
Code:
resource_id, system_id, state
State is a UserType, not sure if that will matter much or not. Anyway, I've been looking at ternary maps, but they do not seem to be exactly what I want. They want to add another column (idx), I guess because they think there could be multiple states for the resource/system pair.
Should I just make a domain object that represents this map? What is the best practice for this type of mapping?