问题
I am looking for a framework or a solution that maps the column names of a database to variables of a Java object. Lets say I have a xml file that contains the element "docid" and its value. The database would contain a table with one column called "ducumentID". I want to compare the two values, so the one value inside the "docid" tag from the xml file and the data entry of the column "docid". Because in this example its just one thing I have to compare it would be easy to do this comparision manually. But later I want to do this with a dynamic count of values. Is there some mapping framework or solution, where I can just say: this xml value is the appropriate value of that database column?
回答1:
Hibernate is popular ORM that implements JPA.
Other ORMs for java:
- OpenJPA
- Entity Beans in EJB
- MyBatis
- EclipseLink
回答2:
you are looking for ORM framework.
here is list for ORM frameworks: Wiki link for ORM
In that Hibernate is Opensource and widely used framework.
来源:https://stackoverflow.com/questions/11755872/mapping-database-column-names-to-java-object-variables