This way, I keep getting the theme line error when I try to start the grails application. Here are my two domain classes that seem to be causing the error.
OnlineOrder:
package rewards
class OnlineOrder {
Date orderDate
Integer orderNumber
Float orderTotal
static belongsTo = [customer:Customer]
static hasMany = [orderItems:OrderItem]
static constraints = {
}
}
OrderItem:
package rewards
class OrderItem {
Integer qty
Float total
static belongsTo = [orders:OnlineOrder, product:Product]
static constraints = {
}
}
The error reads as: Caused by: org.hibernate.MappingException: Missing type or column for column[order_items_order_item] on domain[rewards.OnlineOrder] referencing[rewards.OrderItem]
He seems to be saying that he has not defined OrderItem yet, and I refer to him as a child in my OnlineOrder domain. But I can’t understand why this is causing the error. The OrderItem class is created in the same directory as OnlineOrder, and is quite simple.
Any suggestions?
source
share