Open wuyichen24 opened 6 years ago
This project currently only supports MySQL. More database suites will be added into this project.
This project is using jpropertiesorm to retrieve the parameters from the external configuration file and populate into the configuration class. For example:
MysqlDbConfig dbConfig = new MysqlDbConfig("config/MysqlDb.properties").initialize();
After grabbing values from the external configuration file, you can pass the object of the configuration class into the constructor of the database-specific DAO (Data Access Object). This level of DAO is database-specific and you can also create an application DAO in the lower level for handling application-specific business logic.
MysqlEntityManagerDao dao = new MysqlEntityManagerDao(dbConfig);
After initializing this DAO, you can use it to execute CRUD operation.