iciql
iciql copied to clipboard
This will get a dto containing the enum as the result of the select.
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
.
appendSelectSQL
copies from appendSQL
and removes only the enum handling.
This will get a dto containing the enum as the result of the select.