I'm playing aroud with Grails and am finding the ORM stuff tedious because I don't fully understand what I'm doing when it comes to domain classes. I'm hoping someone can put me back on track
Consider the following
Test Job One:Many Hardware Used on Job Many:One Physical Hardware
...this is analogous to the classic Order, OrderLine, Product scenario seen in university DB examples
I've created the following domain classes
class Job
{
String jobName
String jobDescription
}
class HardwareOnJob
{
static hasMany = [ jobs:Job, physicalHardware:PhysicalHardware ]
static belongsTo = Job
String role
}
class PhysicalHardware
{
String assetName
String model
String os
}
The question I need to ask is why does Grails create me two extra tables in my database rather than using the link entity/domain class I've defined. For instance Grails creates hardware_on_job_job and hardware_on_job_physical_hardware in the database.
Using the scaffolded controllers I can enter some hardware, enter a job and then enter link the two together. The question I have is why does it create these two extra tables rather than use the domain object (HardwareOnJob) I've specified.
Any help/guidance would be very much appreciated as going nuts looking at this and trying new things. Btw I'm on grails version 1.2.1