I need to create a many to many relation between an entity and an enum lookup table using a join table with extra attributes. I know how to write up such relation between two entity tables but I don't think the same technique can be used when the other table is an enum lookup table.
Enum table:
public enum SAMPLE implements StringValuedEnum {
A("1123"),
B("231"),
C("311"),
D("4001");
private String dbCode;
SAMPLE(String dbCode) {
this.setDbCode(dbCode);
}
@Override
public String getDbCode() {
return this.dbCode;
}
public void setDbCode(String dbCode) {
this.dbCode = dbCode;
}
} I am sure this is not a new problem. Any suggestions?