lishunli / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

@ToString should catch Exceptions #587

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you use @ToString on Entities you may face the problem that some fields were 
lazily loaded and if the (Hibernate-)Session is already closed you get an 
org.hibernate.LazyInitializationException in the toString()-Method.

We could exclude all lazy loaded fields, but I think it would be better if the 
generated toString()-Method catches all exceptions while accessing the fields 
and if some exception happens it outputs <Not loadable> ore something like this 
for the failed field. A @ToString Method should not throw any exception ;)

Original issue reported on code.google.com by witte...@gmail.com on 9 Oct 2013 at 10:28

GoogleCodeExporter commented 9 years ago

Original comment by askon...@gmail.com on 9 Oct 2013 at 10:40