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
Hello,
I have the following problem which I do not know how to solve.
I have "Candidates" as well as "Skills" which own have their own table and I want a many to many relationship between them where the "level" is an attribute of the table which links both Entities:
object Candidates: UUIDTable() {
val name = varchar("name", 50).index()
val age = short("age").nullable()
val created = datetime("created")
val updated = datetime("updated")
}
classCandidate (id:EntityID<UUID>) : UUIDEntity(id) {
companionobject:UUIDEntityClass<Candidate>(Candidates)
var name by Candidates.name
var age by Candidates.age
var skills by Skill via CandidateSkills
}
object CandidateSkills: Table() {
val candidate = reference("candidate", Candidates, onDelete =ReferenceOption.CASCADE).primaryKey(0)
val skillName = reference("skillName", Skills, onDelete =ReferenceOption.CASCADE).primaryKey(1)
val level = short("level")
}
object Skills: UUIDTable() {
val skillName = varchar("skill_name", 40).index()
}
classSkill(id:EntityID<UUID>) : UUIDEntity(id) {
companionobject:UUIDEntityClass<Skill>(Skills)
var skillName by Skills.skillName
// How get this to work?var level by CandidateSkill referencedOn CandidateSkills.level
}
The documentation does not mention how to reference such an attribute.
Could somebody help me please?
Best regards. Mike
The text was updated successfully, but these errors were encountered:
Hi, I have had the same problem in the past, but my issue @ #928 has not been addressed. Kind of sad actually, since this is a really good ORM, but without basic SQL functionality it is not suitable at all for larger projects, so I suggest you switch to something else if you plan on doing more complex things than having a few int-id-PK tables.
Has anyone found a workaround for it yet? Earlier today i said nice things about JetBrains, but now seeing that ORM system cannot do basic thing like that, makes me think another way. It has been a year from last comment...
Hello,
I have the following problem which I do not know how to solve.
I have "Candidates" as well as "Skills" which own have their own table and I want a many to many relationship between them where the "level" is an attribute of the table which links both Entities:
The documentation does not mention how to reference such an attribute.
Could somebody help me please?
Best regards. Mike
The text was updated successfully, but these errors were encountered: