I am thinking of using lazy initialization of collections in thier getters:
example:
private java.util.Set<MyEntity> myEntities;
|
| public java.util.Set<MyEntity> getMyEntities() {
| if (myEntities == null) {
| myEntities = new HashSet<MyEntity>();
| }
| return myEntities;
|
| }
this would be nice because I would not need the explicit null checks in my buissneslogic.
however I have a bad feeling about this - I'm if this will work in all cases with lazy
loading, hibernate proxies and stuff I might not even know about.
What do you think?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168918#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...