You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm currently evaluating Exposed as an ORM for for a simple web application. Running the test below on Java 17, Exposed version 0.38.2 and H2 in-memory db.
Table and entity definitions:
object Requests : IdTable<String>() {
val reqId: Column<String> = varchar("reqId", 256)
override val primaryKey = PrimaryKey(reqId)
override val id: Column<EntityID<String>> = reqId.entityId()
}
class RequestEntity(id: EntityID<String>) : Entity<String>(id) {
companion object : EntityClass<String, RequestEntity>(Requests)
var reqId by Requests.reqId
}
The following test fails with Requests.reqId is not in record set:
@AlexeySoshin sorry, I've just noticed your comment. Not really, this is by design. Request id is an internal UUID, which is a formatted timestamp augmented with some random suffix and name of the sub system that generated it.
A way to workaround this issue would be to introduce an auto-increment id column which would be there just for the technical purposes, but I'd prefer not to do this as request id is unique, and it's a primary key.
Hi, I'm currently evaluating Exposed as an ORM for for a simple web application. Running the test below on Java 17, Exposed version 0.38.2 and H2 in-memory db.
Table and entity definitions:
The following test fails with
Requests.reqId is not in record set
:Looking into debug, I can see that the column comparison fails because of the type mismatch -
EntityIDColumnType
vsVarCharColumnType
.If I change the entity mapping as such
and change the insert accordingly, the test passes.
Please advise if there's something I'm missing. (Also, it would be nice to include an example with non-int id in docs.)
The text was updated successfully, but these errors were encountered: