I have many tables with data which are used as properties in my application. These data change very infrequently, they are like constants. In my application I have some classes enum which represent those tables, this is one of them:
public enum MyEnum {
ENUM_ONE {
public String getCode() {
return "1";
}
},
ENUM_TWO {
public String getCode() {
return "2";
}
};
private static final String tableName = "MYENUMTABLE";
public abstract String getCode();
public String getTableName() {
return tableName;
}
}
The thing is that, as you can see in the code above, this is hardcode (isn't it?), so I wonder if it possible to create some code to load these properties when the application starts-up.
The application is built with Java, Hibernate, Spring framework, Oracle 11.2.0.3 ... maybe it exists something with any of these tools.
Thanks in advance.