问题
I am trying to access view objects from Java method.
These objects are not viewed in my page. so I cant use getter and setter methods.
Is there a way I can retrieve data from these view objects using SQL queries?
回答1:
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.
Just access the app module first and then get the required ViewObject and you can perform the required query on that.
来源:https://stackoverflow.com/questions/22465418/accessing-an-object-from-other-method