从其他方法访问对象 [英] Accessing an Object from other Method

查看:67
本文介绍了从其他方法访问对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 Java 方法访问视图对象.

I am trying to access view objects from Java method.

这些对象未在我的页面中查看.所以我不能使用 getter 和 setter 方法.

These objects are not viewed in my page. so I cant use getter and setter methods.

有没有办法使用 SQL 查询从这些视图对象中检索数据?

Is there a way I can retrieve data from these view objects using SQL queries?

推荐答案

从视图层访问视图对象不是一个好的做法.但是,如果您需要访问的所需视图对象添加到应用程序模块中,那么您就可以从模型层访问与jsf页面中使用的视图对象相关的方法(VOImpl和VORowImpl).

Accessing view objects from the view layer is not a good practice.How ever if the required view object which you need to access is added to application module then you can access that from the model layer methods(VOImpl and VORowImpl) pertaining to the view object used in the jsf page.

只需先访问应用模块,然后获取所需的 ViewObject,您就可以对其执行所需的查询.

Just access the app module first and then get the required ViewObject and you can perform the required query on that.

这篇关于从其他方法访问对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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