iciql icon indicating copy to clipboard operation
iciql copied to clipboard

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

Open uchicom opened this issue 1 year ago • 0 comments

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.

uchicom avatar Jun 06 '23 01:06 uchicom