Also when using selectAsXXX in such a context, I g...
# komapper
d
Also when using selectAsXXX in such a context, I guess the autoincrement field will anyways be ignored here, so I can just use literal(0)?
t
No. Use the ID property of the entity to be inserted.
Copy code
QueryDsl.insert(b).select {
    // The id property must be set to the id property of the entity to be inserted.
    QueryDsl.from(x).selectAsBox(id = b.id, color = x.color)
}
d
Oh, I'm really starting to get confused about the behaviour of auto-increment fields... but I guess in this case it makes sense... it just seems a bit superflous, why not just generate the function without that id parameter and fill it in in the function automatically? It'll for sure be the same in all cases anyways...