I try to excute the servlet code given, like an exemple to understand how it works. BUT I did not understand from where the attribut optionDAO and what is the necessity to use it. The find method seems like the given by hibernate in package".base". What should I really do to skip this. Thanks.
A:
It's just a fictive code example according the DAO pattern with a self-explaining classname and methodname which you need to write/implement yourself. E.g.
public class OptionDAO {
public List<Option> find(String dd, String val) {
// Write code here yourself which does the desired task: returning
// a list of options based on the given dropdown id and value.
return options;
}
}
The way how to do it namely differs per environment, ORM libraries used, datamodel design, etc.. that it's impossible to give a concrete code example. Examples how to do it with "plain vanilla" JDBC can be found here. Examples how to do it with Hibernate can be found here. Examlpes how to do it with JPA can be found here.
BalusC
2010-03-17 13:50:47