Hibernate version: 3.0.5
I have an persistent object with mapped collections.
SalesTransaction
SalesTransactionItems
SalesTransactionPayments
The items and payments are lazy initialized, and I use Hibernate.initialize in my DAO's for the instances where the view is going to need the item/payment details.
My problem comes in debugging, and the toString method of SalesTransaction.
I am looking for some way to detect if the mapped collections of my now detached SalesTransaction are initialized or not.
If they are, I can include their details in the toString, and the log, otherwise I want to stay away from them with a 10ft pole to prevent the expected LazyInitializationException.
The only solution I have come up with is to subclass SalesTransaction with a SalesTransactionFull what would always have the collections initialized and a different toString, but it seems a PITA just so I have some more detail in my debug logs..
|