Need help about grails domain class design

I need to create grails domain class like this(see image),but I don't know how to do. Can someone please give me the solution,please?

Image : http://www.uppicweb.com/x/i/ib/6demo.jpg

Upvotes: 0

Views: 296

Answers (3)

Paras
Paras

Reputation: 824

Also, if there is requirement that name of your id should be product_id, cart_id etc then you have to look at the documentation how to do that. Otherwise, in grails by default the id field name is id only.

Upvotes: 0

amra
amra

Reputation: 16875

It's quite simple. You need to create a domain class for each box in your picture. That means:

  • Customer
  • Cart
  • Product
  • Product_comment
  • Product_category
  • Bill
  • Bill_item

Take a look on GORM documentation.

Then you can create controllers with scaffolding and start to play.

Upvotes: 2

hvgotcodes
hvgotcodes

Reputation: 120138

From the picture, you don't need a single domain class. You need one for every box in your image. So you would have a 'Customer' domain object, 'ProductComment', 'Product', etc, and you would relate them via the techniques discussed in chapter 5 of the Grails documentaiton.

There should be plenty of information on the interwebs about this, you can start here:

http://grails.org/doc/latest/

Upvotes: 2

Related Questions