Mapping database column names to Java object variables

≡放荡痞女 提交于 2020-01-17 04:49:29

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!