Using hints from MSSQL with QueryDSL and usage of SQLServerQueryFactory with collection join #3457
Unanswered
gorbachevsasha
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible somehow to use specific MSSQL with JPAQueryFactory?
Maybe to write some custom code for this purpose?
I have found them in SQLServerTableHints query dsl.
At the moment we are using JPAQueryFactory, but hints are possible to use only with SQLServerQueryFactory us I understood. (or native)
My second questions is
How it is possible to re-write join with collection (SetPath - CollectionExpression) from JPAQueryFactory to usage of SQLServerQueryFactory with join?
I have started to re-write JPAQueryFactory with SQLServerQueryFactory , but faced up with that join with signature SetPath is not possible
public <P> Q join(CollectionExpression<?, P> target, Path<P> alias) {
is missing for some reason in ProjectableSQLQuery, but in queryMixin such method exist.
only these methods are present (in ProjectableSQLQuery):
![image](https://user-images.githubusercontent.com/43885705/211524644-57e3f695-f792-45a1-be53-863b5ee880df.png)
![image](https://user-images.githubusercontent.com/43885705/211524932-9b04b5a4-4167-47a1-b554-ebc141422b6f.png)
but I need to use collection method (like it was in JPAQueryBase):
entityName.collectionElements - is of type com.querydsl.core.types.dsl.SetPath (CollectionExpression)
SQLServerQueryFactory queryFactory = new SQLServerQueryFactory(getConnectionProvider()); queryFactory.selectDistinct(entityName.id, entityName.date) .from(entityName) .join(entityName.collectionElements, elementCollectionAlias)
.join(entityName.collectionElements, elementCollectionAlias) - how it possible to perform with SQLServerQueryFactory ?
Thank you for help.
Beta Was this translation helpful? Give feedback.
All reactions