Closed belovaf closed 1 month ago
Model:
@Entity @KeyUniqueConstraint interface Child : SerialId { @Key @OneToOne val parent: Parent val name: String } @Entity interface Parent : SerialId { @OneToOne(mappedBy = "parent") val child: Child? val name: String }
Code:
sql.save(Parent { id = 1 child { name = "new name" } }) { setMode(SaveMode.UPDATE_ONLY) setAssociatedModeAll(AssociatedSaveMode.UPDATE) }
Generated sql:
update CHILD set ID = ID, NAME = ? where PARENT_ID = ? returning ID
Expected sql:
update CHILD set NAME = ? where PARENT_ID = ? returning ID
Done, please pull the branch dev
dev
Model:
Code:
Generated sql:
Expected sql: