I have four domain classes having common properties, transID, createdDate
wherein the transID
is typed int
and mapped as the Primary Key of the table. By rule of abstraction, we seperate the common properties/attributes to an abstract class then let the child class (which in my case the four domain classes I have) inherit them or extends
it.
In my abstract class contains the two properties transID, createdDate
but since the transID
is set to be the Primary Key of the four child classes I have formatted this mapping inside the abstract class.
static mapping = {
id generator: 'increment',
name: 'transID',
column: 'transID',
type: int
}
I have no errors in running the project then, but when I check the tables on the dbconsole, I can't see the four tables with relation to the four domain class yet I only see the abstract class having the properties of the first child.
Is there a way to abstract the id of the mentioned domain classes or I have to mapped it to the child classes rather than having it in the abstract class.
Thanks.