Open keshavsahu10 opened 11 months ago
Can you give an example what is not working. In case you get an error message, can you provide the error?
There is set of integration tests for $expand, which where green, so I assume that there your case is missing.
Odata Query : /Workers?$expand=Title Both Worker and Title related to eachother by OneToOne,
Error : getProcess : URL - /zip/odata/Workers , Query string - $expand=Title 2023-07-24 18:59:10.832 WARN 25528 --- [http-nio-8988-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 169, SQLState: S0001 2023-07-24 18:59:10.834 ERROR 25528 --- [http-nio-8988-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : A column has been specified more than once in the order by list. Columns in the order by list must be unique.
One additional question:
If you look at generated SQL statement in the logs, does it also contain duplicates in the Select clause?
select distinct title1_.[LongDescription] as col_00, title1_.[TitleId] as col_10, title1_.[Code] as col_20, title1_.[ShortDescription] as col_30 from [tx].[viWorker] worker0 inner join [tx].[Title] title1 on worker0.[TitleId]=title1.[TitleId] where worker0.[WorkerId]>=1 and worker0.[WorkerId]<=1000 **order by title1.[TitleId] asc, title1_.[TitleId] asc;**
In order by clause it's duplicate
Actually, I'm not able to reproduce this. The OrderBy clause is created in JPAAbstractExpandQuery#createOrderByJoinCondition. Looking at the code, I assume that there is problem with the metadata generation. Is it okay to provide the code of entity _viWorker?
Yes we can , but actually _viWorker is an view not entity, we are making use of view instead of entity as per our requirement, but same thing is working in 1.0.8 version.
It should not make a difference is your jpa entity based on a view or a table.
As we have upgraded jpa processor to 1.0.9, expand functionality is not working but same is working with 1.0.8