Home How to add data to database using Grails when there is oneTo many relationship?
Reply: 0

How to add data to database using Grails when there is oneTo many relationship?

user499
1#
user499 Published in May 22, 2018, 4:35 am

i tried to add data to my database using domain classes . i have oneToMany relationShip .. a cusomer could have one to many package. and a Package belongTo a customer . why i cant see any thing in DataBase with the flowing lines ?

    Package p1 = new Package (packageId: '123456' , packetName: 
   'xx',packetVariant: 'pull').save()
    new Customer(clientId: '10100380', country: 'DK', name: 'Nybolig 
    Ringsted', comment: '').addToPack(p1).save()
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301537 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO