« Return to Thread: How to avoid retrieving an OneToMany collection?

Re: How to avoid retrieving an OneToMany collection?

by Rich Livingstone :: Rate this Message:

Reply to Author | View in Thread

Would weaving be required for a OneToOne lazy relationship to work ? It relates to another thread we've been discussing for a couple of days

Thanks

Richard

James Sutherland wrote:
If you set the fetch to LAZY the OneToMany will not be read until you access it.  Ensure that you do not access the relationship in your code.  Also ensure that you are using weaving (not required for OneToMany LAZY, but required for ManyToOne LAZY).

If you never intend to read the topics, then you are better off not mapping it, and just querying it.

 « Return to Thread: How to avoid retrieving an OneToMany collection?