-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.39.1 breaks my application #1588
Comments
Seems like Exposed is not able to figure out the name of the table from your table class.
Can you please rename your |
@pindab0ter , can you share your |
The table name was already explicitly defined: object Coops : IntIdTable() {
override val tableName = "coops"
The project uses Java version 11 (Azul Zulu 11.0.16, specifically), defined through This is what import org.jetbrains.exposed.dao.id.IdTable
import org.jetbrains.exposed.sql.ReferenceOption.CASCADE
import org.jetbrains.exposed.sql.jodatime.datetime
import org.joda.time.DateTime.now
object Farmers : IdTable<String>() {
override val tableName = "farmers"
override val id = text("id").entityId()
override val primaryKey = PrimaryKey(id)
val userId = reference("id", Users, CASCADE, CASCADE)
// text, integer, double and long fields
val createdAt = datetime("created_at").clientDefault { now() }
val updatedAt = datetime("updated_at").clientDefault { now() }
} I would like to reiterate that version 0.38.2 doesn't have this problem. The earlier mentioned // Farmer.kt (DAO)
// ...
var coops by Coop via CoopFarmers
// ...
// Coop.kt (DAO)
// ...
var farmers by Farmer via CoopFarmers
// ...
// CoopFarmers.kt (DSL)
object CoopFarmers : Table() {
override val tableName = "coop_farmers"
val farmer = reference("farmer", Farmers, CASCADE, CASCADE)
val coop = reference("coop", Coops, CASCADE, CASCADE)
init {
index(true, farmer, coop)
}
} |
I was able to reproduce the bug, will fix it with next release. object Farmers : IdTable<String>{"farmers") { ... }
object CoopFarmers : Table("coop_farmers") { ... } It should help |
Awesome! Glad to hear you were able to reproduce the problem. Thank you for providing a workaround as well. I will give that a go. Do you want to leave this issue open until there’s a commit/PR/release with a fix, or should I close it? |
I'll close it just after all tests will pass on CI. |
When updating from 0.38.2 to 0.39.1 or .2 my application breaks.
When I'm trying to load one or more instances of the
Farmer
DAO from theFarmers
DSL, this error occurs:The error message doesn't tell me what went wrong specifically. It's not clear to me, at least.
Even though I'm not loading or using this relationship (no eager loading or calling it), it seems to originate in the
Coops
DSL, with the relation defined like this:Unfortunately I can't open source the code. So please let me know what more details I should provide.
The error occurs even when the
coops
table is completely empty. No non-nullable fields in Farmer are null.With 3.8.2 this worked without a problem.
The text was updated successfully, but these errors were encountered: