将数据库列名称映射到Java对象变量 [英] Mapping database column names to Java object variables

查看:255
本文介绍了将数据库列名称映射到Java对象变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个框架或解决方案,将数据库的列名映射到Java对象的变量。
假设我有一个包含元素docid和其值的xml文件。数据库将包含一个包含一个名为ducumentID的列的表。
我想比较这两个值,所以来自xml文件的docid标记中的一个值和列docid的数据条目。因为在这个例子中,它只是一个事情,我必须比较,这将是很容易做手动比较。但后来我想用动态计数值来做到这一点。
有一些映射框架或解决方案,其中我可以说:这个xml值是该数据库列的适当值?

解决方案

Hibernate 是受欢迎的 ORM ,它实现了 JPA 。 / p>

其他用于java的ORM:




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?

解决方案

Hibernate is popular ORM that implements JPA.

Other ORMs for java:

这篇关于将数据库列名称映射到Java对象变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆