2011-01-23 110 views
3

我有一个应用程序,我需要使最终用户通过某种类型的向导,其过程会是这样定义他们的选项来创建即席报告:与Hibernate动态查询

1) User selects the table(s) he wants to query (eg person, project, activities) 
2) defines the list of fields he requires (eg name, email, projects, activity, activity info) 
3) supplies the filter criteria for the records to return (eg Person name, ongoing activities) 

我使用与Hibernate postgres数据库超过100个表。当然,我不能让用户选择任何表格,因为他们没有意义。但是有10个主表(例如上面的表格)。

所以我需要建议如何:

  1. 是否可能,如何定义连接和关系这些表和他们的其他关系之间动态?
  2. 如果不是(或者太复杂),那么预定义这些连接和数据库路径的最佳方法是什么,然后让用户只参数化过滤器?
  3. 从多个hibernate对象中获取数据,然后让用户选择他想要的字段。

我很欣赏所有的反馈,如果我没有正确解释需要,请写。

回答