简体   繁体   English

JHipster:如何使用Jhipster将数据从Excel文件导入数据库中的我的实体?

[英]JHipster: how to import data from Excel file into my Entity in the database using Jhipster?

I'm new to JHipster and i'd like to add a button that allow me import Excel file to fill my entity in the database . 我是JHipster的新手,我想添加一个按钮,该按钮允许我导入Excel文件以填充数据库中的实体。 could anyone help me or give an idea 谁能帮我或提个主意

thank you 谢谢

One way will be to define a table eg sourceFile which should have at least one field of type TextBlob . 一种方法是定义一个表,例如sourceFile ,该表应至少具有一个TextBlob类型的字段 JHipster will create for you all the ui for uploading a file in the table sourceFile . JHipster将为您创建用于在表sourceFile中上传文件的所有ui。 Then u can create a service which is using a lib like apache poi for reading and importing the uploaded excel file. 然后,您可以创建一个使用apache poi之类的库的服务,以读取和导入上载的excel文件。 In this way u can write some audits about when the file was upload and imported. 这样,您就可以编写有关何时上传和导入文件的审核信息。 Of course it's depends on your use case if this is feasible or not for you. 当然,这对您而言是否可行取决于您的用例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM