aditya zagade (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *commented* on HHH-17060 (
https://hibernate.atlassian.net/browse/HHH-17060?atlOrigin=eyJpIjoiMDEyYW...
)
Re: QuerySyntaxException: Unexpected Exception thrown when JOIN used for Entities
who's Fully Qualified Domain Name starts with 'in' (
https://hibernate.atlassian.net/browse/HHH-17060?atlOrigin=eyJpIjoiMDEyYW...
)
Spring + JPA + Hibernate example
@Query("""
select address from AddressEntity address inner JOIN VendorEntity vendor where
address.workspaceId = :workspaceId and
address.partyId=:partyId and
address.partyType=:partyType and
address.partyId=vendor.id and
address.status in (:statuses) and
vendor.status = :vendorStatus
""")
List<AddressEntity> getCheckVendorAddresses(
@NonNull @Param("partyId") String partyId,
@NonNull @Param("partyType") PartyType partyType,
@NonNull @Param("addressScopeType") AddressScopeType
addressScopeType,
@NonNull @Param("workspaceId") String workspaceId,
@NonNull @Param("vendorStatus") Status vendorStatus,
@NonNull @Param("statuses") List<AddressStatus> statuses
);
Spring+JPA Used, However, this is not a spring JPA issue. It throws following exception
when JPA Query is validated.
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: in near
line 1, column 72 [select address from in.abcdef.model.AddressEntity address inner JOIN
in.abcdef.vendor.entity.VendorEntity vendor where
address.workspaceId = :workspaceId and
address.addressScopeType=:addressScopeType and
address.partyId=:partyId and
address.partyType=:partyType and
address.partyId=vendor.id and
address.status in (:statuses) and
vendor.status = :vendorStatus
]
at
org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74)
at org.hibernate.hql.internal.ast.ErrorTracker.throwQueryException(ErrorTracker.java:93)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:301)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:189)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:144)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:113)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:73)
at
org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:162)
at
org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:636)
at
org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:748)
... 172 common frames omitted
(
https://hibernate.atlassian.net/browse/HHH-17060#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17060#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100234- sha1:90f5128 )