dave08
06/03/2024, 2:56 PMToshihiro Nakamura
06/03/2024, 10:51 PM*@KomapperId(*virtual *=*
true)
for the entity.Toshihiro Nakamura
06/03/2024, 11:04 PM@KomapperProjection
.
@KomapperProjection
data class YourView(
...
)
val y = ProjectionMeta.YourView
val query = QueryDsl.from(y)
dave08
06/04/2024, 9:12 AMcolumn t0_.id does not exist
io.r2dbc.postgresql.ExceptionFactory$PostgresqlBadGrammarException: [42703] column t0_.id does not exist
So I guess I'll have to try with a projection... although I didn't know it could be used like that in the querydsl...? If so, that's better...dave08
06/04/2024, 9:14 AMToshihiro Nakamura
06/04/2024, 9:56 AMEven with virtual = true, it still gives me:That error message is not output by Komapper. Is that error related to the entity definition in Komapper?
Toshihiro Nakamura
06/04/2024, 9:58 AMa projection by itself wouldn’t know which table to queryTry following code:
@KomapperProjection
@KomapperTable("EmployeeView")
data class YourView(
...
)
val y = ProjectionMeta.YourView
val query = QueryDsl.from(y)
dave08
06/04/2024, 10:06 AMThat error message is not output by Komapper. Is that error related to the entity definition in Komapper?That field really doesn't exist on the table... but I thought that a Komapper Entity w/o an id field (which I don't have in this case...) won't work? So I added the field and thought that virtual would make it that Komapper doesn't look for it at all in a query.
Toshihiro Nakamura
06/04/2024, 10:58 AM@KomapperId (virtual = true)
to fields that exist in the View and are substantially unique.