I have a Record class as :
class Record {
Date dateCreated
Date lastUpdated
def beforeInsert() {
dateCreated = new Date()
}
def beforeUpdate() {
lastUpdated = new Date()
}
static mapping = { tablePerHierarchy false }
}
And this class is inherited by several other domain classes - for example :
class User extends Record{
String userName
String password
String email
}
My question here is : Is there any way to embedd the columns of Record table into the table which extends it?
You can define tablePerClass
or tablePerHierarchy
strategies.
See documentation here.
So, following, your code you should use:
static mapping = {
tablePerHierarchy true
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With