Skip to content

Conversation

@uchicom
Copy link
Contributor

@uchicom uchicom commented Jun 6, 2023

I want to do this.

SQL

select id,name from book;
select id,book_id,count,kind from stock; // kind is enum
↓ join select
select T1.id, T1.name, T2.kind from book T1 inner join stock T2 on T1.id = T2.book_id

iciql

Book b = new Book(); // entity
Stock s = new Stock(); // entity
db.from(b).innerJoin(s).on(b.id).is(s.book_id).select(
  new BookStock() { // dto
    {
      id = b.id;
      name = b.name;
      kind = s.kind; // kind is enum.
    }
});

However, an error has occurred.The cause is a special case of Query.java.
For select object enum, I removed a special case.

appendSQL is used in select and where.
Changed to use appendSelectSQL only for select.
appendSelectSQLcopies from appendSQL and removes only the enum handling.

This will get a dto containing the enum as the result of the select.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant