简体   繁体   English

JPA bean的JSF可编辑数据表,一种大小适合所有

[英]JSF editable datatable for JPA beans, one size fits all

I would like to have a JSF page with an editable datatable to provide basic CRUD capability for a assorted number of JPA-enabled beans. 我想拥有一个带有可编辑数据表的JSF页面,以为各种支持JPA的bean提供基本的CRUD功能。

How to do it for a specific class, is already done: http://forum.primefaces.org/viewtopic.php?f=3&t=9026 如何针对特定的类进行操作,已经完成: http : //forum.primefaces.org/viewtopic.php?f=3&t=9026

My question: how can I populate the datatables for the JPA beans without knowing what bean I am going to edit before runtime? 我的问题:如何在不知道要在运行时之前编辑哪个bean的情况下填充JPA bean的数据表? How do I pass the bean fields to the datatable without creating a separate page for each bean (around 10 at the time of this writing). 如何在不为每个bean创建单独页面的情况下将bean字段传递给数据表(在撰写本文时大约为10)。

Take a Look at tools for rapid development with scaffolding support, such as JBoss Forge ( JSF Scaffolding by default) and Spring Roo (Very good JSF Add-on ). 看看具有脚手架支持的快速开发工具,例如JBoss Forge (默认情况下为JSF Scaffolding )和Spring Roo (非常好的JSF插件 )。

These are not exactly what you are looking for (a monolithic generic view component that handles everything), but will generate simple CRUDS in seconds and handle most of the boilerplate code and repetitive tasks. 这些并不是您真正想要的(一个处理所有问题的整体式通用视图组件),而是将在几秒钟内生成简单的CRUDS,并处理大多数样板代码和重复性任务。 The end result is fairly maintainable and modular code which programmers can (relatively) easy improve and take finer-grained control of when they have to. 最终结果是相当可维护的模块化代码,程序员可以(相对)轻松地进行改进,并对何时需要进行更细粒度的控制。

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

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