This content has been marked as final.
Show 2 replies
-
1. Re: How to create an POJO View made of other POJOs
dornus Jan 26, 2006 11:00 AM (in response to dornus)Another question I have is how efficient is it to embed a POJO within a view as opposed to having a variable for each field within the POJO.
For example, if I am going through a loop of resultsList<MyPojoView> myResultList = ...; for (MyPojoView myPojo : myResultList) { myPojo.getPojo.getSomeField(); //etc..get a bunch of fields this way }
am I executing a new query each time getPojo.getSomeField() is called?
If myPojoView was set up so that the fields were directly in that class, then it would beList<MyPojoView> myResultList = ...; for (MyPojoView myPojo : myResultList) { myPojo.getSomeField(); //etc..get a bunch of fields this way }
Which would not have any additional queries.
So, I'd assume it would be more efficient to place all variables of MyPojo in the MyPojoView class instead of adding myPojo to MyPojoView.
Any comments? I'm curious to see what others think -
2. Re: How to create an POJO View made of other POJOs
dhartford Jan 26, 2006 11:33 AM (in response to dornus)I'm also interested in this question from the 'Business Delegate' point of view.
i.e. Build an application that has 'Business Delegate' POJO's, but the application talks to diverse database schemas that may contain the same information.