Database Modelling and Tools

Slack Discussion Repositories https://github.com/terawarehouse/terawarehouse-catalog https://github.com/terawarehouse/terawarehouse-react In...

Slack Discussion

Repositories
In this part, we will discuss the tools that we can use in designing our database. We will also create a database schema of our catalog project.

I normally use SQL Power Architect when I’m designing a database schema of a project from scratch. I include the primary as well as the foreign keys but not the rest of the columns since for now, I’m only after about the relationship of the tables with each other.

[show the SQL power architect]


Again, here’s our schema. Really there’s nothing trivial here.

Let’s create the java classes accordingly. 

When dealing with business entities like category, product, dealer, dealer group, etc we normally assign a unique identifier to them. Let’s call that code and let’s also add a description. At the very least, we now have 2 common fields within a subset of the entity classes and note that we have the primary key id too.

[show businessEntity class]


We can refactor code and description as an abstract base class. Let’s name it BusinessEntity. And we could go further like creating abstract EnableEntity which as the name implies, lets us enable and disable an entity. AuditableEntity, which has an embeddable field Auditable that contains the author and date when an entity is created or updated. And finally, the BaseEntity which contains the autogenerated id of UUID type.

[show enable, auditable and base entity classes]
Let’s take a look at the entity classes and compared it to our schema diagram.

COMMENTS

mas template
Name

amazon,1,angular,8,bigdata,2,business,1,course-spring,27,courses,6,database,4,docker,3,java,50,kafka,1,keycloak,4,microservices,5,mysql,1,neworking,1,nosql,2,php,1,pinned,2,react,3,server management,7,shared drive,1,spring,7,synology,1,troubleshooting,2,web,1,wordpress,1,
ltr
item
toztech: Database Modelling and Tools
Database Modelling and Tools
https://i.ytimg.com/vi/ByMsvyU2vkc/0.jpg
https://i.ytimg.com/vi/ByMsvyU2vkc/0.jpg
toztech
https://toztech.blogspot.com/2019/06/database-modelling-and-tools.html
https://toztech.blogspot.com/
https://toztech.blogspot.com/
https://toztech.blogspot.com/2019/06/database-modelling-and-tools.html
true
2554149350007112447
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content