MappedSuperclass

30 views
Skip to first unread message

Armando Flores Ibarra

unread,
Jun 22, 2016, 4:32:06 AM6/22/16
to Querydsl
 First of all, I need to say that any of these classes can be changed.

Here is my situation:

- He have an abstract class named BaseLocation annotated with @MappedSuperclass

- BaseLocation has a Country (@ManyToOne) and a StateProvinceCode (@ManyToOne)

- SiteDetail class extends from BaseLocation

- Location class extends from BaseLocation

- SiteDetail has a Location (@ManyToOne)


QSiteDetail qSiteDetail = QSiteDetail.siteDetail;

This works:

qSiteDetail.country.[any Country field]
qsiteDetail.stateProvinceCode.[any StateProvinceCode field]

But this doesn't:

If we try to do this, we get a NullPointerException because both country and stateProvinceCode are null

qSiteDetail.location.country.[any Country field]
qsiteDetail.location.stateProvinceCode.[any StateProvinceCode field]


Any help would be really appreciated.

Thank you.

timowest

unread,
Jun 23, 2016, 11:40:29 AM6/23/16
to Querydsl
Hi.

What you are encountering is limited path initialization depth http://www.querydsl.com/static/querydsl/4.1.2/reference/html_single/#d0e2260

Timo

Armando Flores Ibarra

unread,
Jul 13, 2016, 4:30:38 PM7/13/16
to Querydsl
Thanks a lot!
Reply all
Reply to author
Forward
0 new messages