EAGER and SUBSELECT

35 views
Skip to first unread message

richar...@taskize.co.uk

unread,
Sep 21, 2015, 4:51:50 AM9/21/15
to Sculptor Generator
Hi -

I want to load multiple collections eagerly.

I want to be able to do something like this.

@OneToMany(mappedBy="parent", fetch=FetchType.EAGER)
@Fetch(value = FetchMode.SUBSELECT)
private List<Child> childs;

How can I achieve this with Sculptor. I can do either EAGER or SUBSELECT but not both it seems. 

Thanks,
Richie. 

Torsten Juergeleit

unread,
Sep 22, 2015, 6:40:03 AM9/22/15
to Sculptor Generator
To use this not JPA compliant fetch strategy a new fetch mode (e.g. "eager_subselect") has to be implemented.

To let DomainObjectReferenceAnnotationTmpl.manyReferenceJpaAnnotations() support this new fetch mode DbHelper.getFetchType() and DbHelper.getHibernateFetchType() must be overriden accordingly.

/Torsten
Reply all
Reply to author
Forward
0 new messages