groovy « Insert « JPA Q&A

1. How do I insert a record with a many-to-one foreign key with grails?

I've been stuck on this for a day now! I'm just getting started with Grails/Groovy. I have two Domain classes with a simple Many-to-one foreign key. Simplified a bit, they are "Company"

class ...

2. insert hibernate domain objects to different database?

I want to copy all data of a specific table from database1 to database2. In my system i have access via hibernate to the domain object from database1, i don't have ...

3. Inserting into DB in JPA in play Framework

I am finding difficult to display the template in play framework using groovy

#{list users, as:'user'} 

#{list items:0..10, as:'i'} 
How to combine the above 2 to ...