-
Notifications
You must be signed in to change notification settings - Fork 695
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
How to use additional columns by Parent-Child reference? #600
Comments
This is possible with |
I tried your approach but I had following Exception: java.lang.reflect.InvocationTargetException Here you can see my Part Entity: class Part(id: EntityID) : IntEntity(id) { |
I don't understand what entity do you want to create. |
Hi, thanks for your quick reply. I need to create a partlist for our products. It's for a operating instructions inside our production Data Acquisition app. So our employees need to know how often which part has to be installed. |
The Entity must have a parent to child relationship and for each the quantity of children there are used. My aim is to get tree of all our products from single screw until final product. |
Bump |
I have a similar problem. I have the parent-child table and am using the Table.via(Table.parent, Table.child) syntax and that works fine. But I also want to store data about that relationship in the same parent-child table. How can I reference that data piece from the parent or child entity? |
I have following two tables. I would like to specify an additional amount per entry for the join table PartToPart. My intention is to create a graph of the different combinations.
object Parts : IntIdTable() {
val partnumber = varchar("partnumber", 120).uniqueIndex()
val description = varchar("description", 255)
val internalDescription = varchar("internalDescription", 255).nullable()
val userId = reference("user", Users)
val parameter = text("parameter").nullable()
val partGroup = reference("partGroup", PartGroups)
}
object PartToParts : IntIdTable() {
val parent = reference("parent", Parts)
val child = reference("child", Parts)
val quantity = integer("quantity")
}
Here you can see my pitiful attempt. What is the right course of action?
class Part(id: EntityID) : IntEntity(id) {
companion object : IntEntityClass(Parts)
var partnumber by Parts.partnumber
var parents by Part.via(PartToParts.child, PartToParts.parent)
var children by Part.via(PartToParts.parent, PartToParts.child)
var quantity by PartToParts.quantity
var description by Parts.description
var internalDescription by Parts.internalDescription
var userId by User referencedOn Parts.userId
var parameter by Parts.parameter
var partGroup by PartGroup referencedOn Parts.partGroup
}
Thank you in advance for your suggestions ;)
The text was updated successfully, but these errors were encountered: