You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the context :
I have a stupid database constraint that forces me to use a projection to get data from tables using joins conditions that use only one column of composite PKs (so not working with JPA specifications of @OneToMany and @manytoone).
My DBA doesn't want to hear about sequence generated IDs... she is very "old school" about DB modelling... she is in love with composite PKs... :(
So... I want to get all the columns of my main bean, and the other data I need.
Yes, it's simple, and I managed to do it by iterating on every column of my bean, no problem.
Something like that :
Projections.bean(qMainBean, qMainBean.firstField, ..., qOtherBean, qStupidJoinBean)
But here is my problem :
Every time I want to add a new column in my @entity bean, I need to go to modify my query to add that new column in my projection. First, that's annoying, and second, it's not good for maintaining the code.
By searching on StackOverflow and then on QueryDSL documentation, I saw a .all() method on Q generated classes to get all the columns of my bean (that's a great thing !), but I don't have that method generated on my Q classes (that's a bad thing !).
How can I get that method on my Q classes ? Am I missing something ?
My configuration :
Spring Platform Athens-SR5 as "parent" project, so QueryDSL 4.1.4 (and I use all libs in dependencies : core, jpa, collections, codegen, sql and apt)
And for generating Q classes, I use com.querydsl.apt.hibernate.HibernateAnnotationProcessor with jpa and apt libs as dependencies in my POM.
The text was updated successfully, but these errors were encountered:
link : #2166
Description:
Hello everybody,
Here is the context :
I have a stupid database constraint that forces me to use a projection to get data from tables using joins conditions that use only one column of composite PKs (so not working with JPA specifications of @OneToMany and @manytoone).
My DBA doesn't want to hear about sequence generated IDs... she is very "old school" about DB modelling... she is in love with composite PKs... :(
So... I want to get all the columns of my main bean, and the other data I need.
Yes, it's simple, and I managed to do it by iterating on every column of my bean, no problem.
Something like that :
Projections.bean(qMainBean, qMainBean.firstField, ..., qOtherBean, qStupidJoinBean)
But here is my problem :
Every time I want to add a new column in my @entity bean, I need to go to modify my query to add that new column in my projection. First, that's annoying, and second, it's not good for maintaining the code.
By searching on StackOverflow and then on QueryDSL documentation, I saw a .all() method on Q generated classes to get all the columns of my bean (that's a great thing !), but I don't have that method generated on my Q classes (that's a bad thing !).
How can I get that method on my Q classes ? Am I missing something ?
My configuration :
Spring Platform Athens-SR5 as "parent" project, so QueryDSL 4.1.4 (and I use all libs in dependencies : core, jpa, collections, codegen, sql and apt)
And for generating Q classes, I use com.querydsl.apt.hibernate.HibernateAnnotationProcessor with jpa and apt libs as dependencies in my POM.
The text was updated successfully, but these errors were encountered: