[英]Performing CRUD operation on massive data attained from a Web-Service
I am working on a project that maintains a list of user and their site in a DB table. 我正在从事一个在数据库表中维护用户及其站点列表的项目。 The user column contains e-mail addresses of the users and corresponding entry contains the website they own.
用户列包含用户的电子邮件地址,相应的条目包含他们拥有的网站。 Something like this:
像这样:
dbTable
==================================
email | website
----------------------------------
user1@abc.com | http://xyz.com
user2@abc.com | http://asd.com
user2@abc.com | http://qwerty.com
user3@abc.com | http://asdfg.com
.
.
The table contains thousands of rows and it is to be populated and maintained as per a Web Service . 该表包含数千行,并将根据Web Service进行填充和维护 。 With the help of JAX-B, I unmarshalled the WS and inserted the data on the first run.
在JAX-B的帮助下,我解组了WS,并在第一次运行时插入了数据。 Now, this table is to be updated as per the web service.
现在,该表将根据Web服务进行更新。 ie users/websites should be updated or deleted according to the data received from the web service .
也就是说, 应该根据从Web服务接收的数据来更新或删除用户/网站 。
My initial idea was to make an ID wrt email+website and store it as a third entry in the table and for future CRUD operations I would just refer to this ID. 我最初的想法是使用电子邮件+网站创建一个ID,并将其作为表中的第三个条目存储,对于以后的CRUD操作,我只引用此ID。 However, my superior advised against coding the whole batch update process by self and use any framework features,
my project uses Spring
, for batch CRUD operations or maybe exploit feature provided by the database, POSTGRESQL
. 但是,我的上司建议不要自行编写整个批处理更新过程,而不要使用任何框架功能,
my project uses Spring
进行批处理CRUD操作,或者利用数据库POSTGRESQL
提供的功能。 Is there any such feature provided in Spring that I can use to perform batch updates on the db? Spring中提供了任何此类功能,可以用来对数据库执行批处理更新吗? Any ideas?
有任何想法吗? Please advice.
请指教。
You could take a look at Hibernate . 您可以看看Hibernate 。 This ORM integrates pretty well with Spring and can do batch operations .
这个ORM与Spring很好地集成在一起,可以执行批处理操作 。 You can take a look here for something similar to what you need to do.
您可以在这里查看与您需要执行的操作类似的操作。
Information here should point you in the right direction as to setting up Hibernate for PostgreSQL. 这里的信息应该为您设置PostgreSQL的Hibernate指明正确的方向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.