JCart: Domain Modelling and Database Designing

Sharing is caring!

While developing database driven applications using some ORM framework, some people prefer Object first approach and others follow DB first approach. I prefer DB first approach.

So, let us start listing down all the domain entities in our JCart application domain.

  • Product
  • Category
  • Customer
  • Order
  • OrderItem
  • Cart
  • Address
  • User
  • Role
  • Permission

Let us create the database tables as follows:

JCart Database Model


Though we identified Cart as a domain entity, we are not creating the table for holding the Cart details. We are going to take the simple approach of storing the active cart details in HttpSession only. But in real applications it is strongly recommended to store them in some persistent storage like database.

Sharing is caring!


  1. Hi Siva
    ER-diagram not getting properly.could you please check on this and
    you have done great job by implementing Jcart applications.
    Thank you so much.

  2. Hi Siva,

    I have one doubt. If we use spring data jpa, when we create entity object is enough for creating the table in DB also. Correct me if I am wrong.


  3. Hi Siva,
    U answered the Madhav Rao that I have updated the ER diagram but you posted “JCart: Domain Modelling and Database Designing” on December,1/2015 and you answered on December,16/17/2015. So the current diagram is updated or not?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.