Reputation: 1949
Is there any way to know the size of a lazily loaded collection without loading the collection object(without writing a @NamedQuery
with COUNT(*)
) ?
Something like @LazyCollection(LazyCollectionOption.EXTRA)
in hibernate ?
Note : I'm using JPA 2.0(EclipseLink)
Thanks
Upvotes: 1
Views: 336
Reputation: 18379
No, size will instantiate the relationship. You need to issue a query to get the size if desired.
Upvotes: 2