<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Kudzai Tsapo</title>
    <description>The latest articles on DEV Community by Kudzai Tsapo (@kudzaitsapo).</description>
    <link>https://dev.to/kudzaitsapo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F193097%2F008b1f7b-fb97-4703-af11-3902509e1fbb.png</url>
      <title>DEV Community: Kudzai Tsapo</title>
      <link>https://dev.to/kudzaitsapo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/kudzaitsapo"/>
    <language>en</language>
    <item>
      <title>More features? Bad idea!</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Tue, 15 Feb 2022 09:05:24 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/more-features-bad-idea-4c43</link>
      <guid>https://dev.to/kudzaitsapo/more-features-bad-idea-4c43</guid>
      <description>&lt;p&gt;Very funny thing happened at this other fictional tech company called SomeCrazyTechCompany LLC. The project manager and business analysts always sat down and discussed requirements, as well as client changes. As usual, the client wanted more features, and as usual, the BAs obliged.&lt;br&gt;
One day, the developer who worked on the system quit, and the company hired another poor soul to take over. Everything went as you would expect. The developer struggled heavily to maintain the system. Let's not talk about bugs, and more requests for features.&lt;/p&gt;

&lt;p&gt;A friend of mine seems to have the same issue. Her problem is not the client; in fact, I could say she &lt;em&gt;is&lt;/em&gt; the problem. Clients always request more features and changes, but in this case, she's the one who more or less asks the developers to make the changes without consulting with the client. And also add more features. And as you would expect, once the system goes into production, it's a mess of bugs and more bugs... and even more bugs.&lt;/p&gt;

&lt;p&gt;For a small system, it's very easy to maintain, discover bugs, and test thoroughly. However, as the system becomes larger and larger, it becomes more difficult and time consuming, to test thoroughly. So, most people usually check to see if it's working, and then update the feature/bug card on the project management tool. However, the issue is, a few minutes later, the same problem will resurface. Or even worse, something will explode ... and it will be related to this problem.&lt;/p&gt;

&lt;p&gt;Unfortunately, as much as it might be great to make a small system, it's very much impossible to keep the system small. What I'm saying is, due to some unfortunate circumstances, that have absolutely nothing to do with the scope of the article, everything will explode at some point. &lt;/p&gt;

&lt;p&gt;There's a wise dude who once said, where there's a possibility of things going wrong, &lt;strong&gt;they will go wrong&lt;/strong&gt;. He was right. And this can be seen in the Software Development sector. If there's a chance that your system will explode, then everything &lt;em&gt;will&lt;/em&gt; go haywire. If it's a smaller system, then it's easier to manage. What about when it's a giganticous (&lt;em&gt;not a real word, I know&lt;/em&gt;) monolith? Good luck.&lt;/p&gt;

&lt;p&gt;That brings me to something else. Solutions to this issue, if there are any.&lt;/p&gt;

&lt;p&gt;A group of people realized that having a large system was a recipe for disaster, or a disaster waiting to happen, or something worse. Being as clever as they are, they decided to break their system into multiple smaller systems. Someone went so far as to give it a name: &lt;strong&gt;Microservices Architecture&lt;/strong&gt;. It was awesome, because if something breaks, you know exactly what broke, possibly why it broke, when it broke, and very much possibly how it broke. It would take a few minutes to fix it, if you're that good. And a few years, if you aren't.&lt;/p&gt;

&lt;p&gt;The problem with this approach, since everything has a problem at some point, is that when you have 200 small systems to maintain, and there's only one of you, how do you do it? Or maybe there's 2 of you ... or 5 ... either way, how do you do it? Do you go and clone yourself and then assign your clones to maintain the systems? &lt;/p&gt;

&lt;p&gt;Well, I just thought I should put it out there for people to think about, if they weren't already thinking about it. Next time your client wants you to create another feature, make sure you know exactly what problems you'll encounter. Once you've managed to somehow do it, make sure you test thoroughly, whatever that means. And make sure to cover all angles, including the ones you think don't matter. When you've exhausted all possibilities, then you should know that once the monster is in production, you might have issues maintaining it a few months from now (&lt;em&gt;if you're lucky&lt;/em&gt;). If you're very unlucky, the monster will blow up the moment it hits production, and the users start using the system.&lt;/p&gt;

&lt;p&gt;Life's great. Bugs aren't. So, before you develop more of those, or ask someone to, think twice or three times. Or four, just for good measure. &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>anything</category>
      <category>programming</category>
      <category>business</category>
    </item>
    <item>
      <title>Tale of the Snake Charmer: Why you should learn Python.</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Mon, 24 Jan 2022 10:59:46 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/tale-of-the-snake-charmer-why-you-should-learn-python-30dc</link>
      <guid>https://dev.to/kudzaitsapo/tale-of-the-snake-charmer-why-you-should-learn-python-30dc</guid>
      <description>&lt;p&gt;It has been several decades since a wise Sage went to the Amazon rain forest. After getting lost, he was found by the natives, who taught him how to speak their language. When he returned to his civilization, he decided to teach the machines how to speak the language.&lt;br&gt;
Fast forward several decades later, Python is one of the most popular programming languages, being used for a variety of tasks which include but are not limited to Machine learning, web development, and mobile app development.&lt;br&gt;
Fast forward a hundred years later,the robots are taking over the planet. There's wanton destruction everywhere, shopping malls are collapsing, and cars are being burnt. An old man peers from a glass office, watching all the events unfold. With tearful eyes, he sighs and says, "If only I hadn't built that damn model with Python!"&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;In case you hadn't noticed, I made up most of the events written up there. There's no moral of the story, if you're wondering.&lt;br&gt;
So, what's the purpose of the article? Basically, it's to give advice to those who need it, and for those who don't, you can click the back button on your browser.&lt;/p&gt;

&lt;p&gt;To be fair, Python is one of the awesome programming languages I've used. It's so easy to learn, compresses a lot of lines of code into a single line. It can also be used for a variety of tasks, from developing mobile apps, to web apps, to machine learning models.&lt;/p&gt;

&lt;p&gt;Just like how there are huge fans of the language (e.g. me), there are also haters. They'll be quick to point out its flaws, but as far as you and I are concerned, they can go and f ... eh ... sleep. &lt;/p&gt;

&lt;p&gt;So, why should you, an awesome person, learn this awesome language?&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Because you can.
&lt;/h4&gt;

&lt;p&gt;First rule of life, there are no rules ... eh ... apart from the laws of your country, laws of physics etc, but you get the point. Nothing restricts you from learning something, except if you don't want to. In fact, open your browser, download Python and get started right away! &lt;/p&gt;

&lt;h4&gt;
  
  
  2. You want to get into data science
&lt;/h4&gt;

&lt;p&gt;One of the reasons why I love python, is the fact that we can prophesy the future using code! (I'm lying of course ... lol) What I mean to say is that, as human beings, we can notice repeating patterns, and try to predict when the next event is going to happen (Think the stock market, wanna try and predict when Tesla stock is going to fall, or rise?). We can come up with statistical models of these events, and Python makes it easy to do so. It has a snake-skin bag of libraries that you can use to achieve whatever goals you want in this field. &lt;/p&gt;

&lt;p&gt;So, if you want to get into data science, you  &lt;strong&gt;should&lt;/strong&gt; learn python! There are no negotiations (unless you want to learn Matlab and R, in which case, be my guest).&lt;/p&gt;

&lt;h4&gt;
  
  
  3. AI will take over the world some day
&lt;/h4&gt;

&lt;p&gt;When this happens, you'd want to cash out on it, right? You'll be one of the wizards who developed Skynet, and caused the apocalypse ... Just kidding! When flying, self-piloting cars and robots have been developed, wouldn't you like to puff out your chest with pride, and say, "I contributed one line of code to this future" ?&lt;/p&gt;

&lt;h4&gt;
  
  
  4. You want to be a tech billionaire?
&lt;/h4&gt;

&lt;p&gt;Ah yes, one of the primary motivations of why people do anything at all! Money! 🤑 So, let's say, you've heard that it's now easy to become a billionaire. The person who told you this said you just had to create a web app, launch, and in a few years you'd be one. Well, I'm sure the person who would've said this would be joking, but jokes aside, using &lt;strong&gt;django&lt;/strong&gt;, it is easy to develop prototypes and it cuts development time by like 50% (I might be lying but 🤷‍♂️). There's also flask, which is so light-weight, you'd wonder if it no bones will break upon deployment. Not forgetting FastAPI, which is awesome for developing APIs apparently (haven't used it much so I dunno). &lt;/p&gt;

&lt;p&gt;Anyways, when you become the tech billionaire you've always wanted to be, don't forget to remember this article 🤣 .&lt;/p&gt;

&lt;p&gt;So, the key take away points are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You're awesome&lt;/li&gt;
&lt;li&gt;Python is &lt;em&gt;really&lt;/em&gt; awesome.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are many reasons why people do things, and I don't know why you want to learn Python. However, I can safely say you're making the right decision 👍 , unless you're planning on taking over the earth with your droids, in which case no! It's a really bad idea!&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>What I learnt developing a system in a couple of days.</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Sun, 24 Oct 2021 17:05:23 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/what-i-learnt-developing-a-system-in-a-couple-of-days-23k2</link>
      <guid>https://dev.to/kudzaitsapo/what-i-learnt-developing-a-system-in-a-couple-of-days-23k2</guid>
      <description>&lt;p&gt;So, being as bored as I was this weekend ( &lt;em&gt;not really&lt;/em&gt; ), I saw a picture of a database schema while browsing the net. I then asked myself, how long would it take me to implement that thing as an entire system? 🤔&lt;br&gt;
Considering I'm totally notorious with &lt;em&gt;not&lt;/em&gt; finishing projects, I decided to give myself the &lt;strong&gt;Ultimate&lt;/strong&gt; deadline of two days ... (&lt;em&gt;lol&lt;/em&gt;), just to make sure I wouldn't spend anymore unnecessary time on it.&lt;br&gt;
You know what the funny thing is? I actually managed to finish the project this time 😅. I mean, that's the purpose of the article 😅.&lt;/p&gt;

&lt;p&gt;Anyways, for the curious, the project can be found on github, the user interface &lt;a href="https://github.com/kudzaitsapo/hr-manager-ui"&gt;here&lt;/a&gt; and the API &lt;a href="https://github.com/kudzaitsapo/hr-manager-web-api"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;I made the API using Asp.net core, and the user interface, I used react + tailwind (&lt;em&gt;an awesome combo apparently&lt;/em&gt;). I tried to make the system as simple as I could, but then stuff happened and it ended up being somewhat ... &lt;em&gt;complex&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;After meeting my weekend deadline, there are a couple of things I learnt:&lt;/p&gt;

&lt;h3&gt;
  
  
  As you approach the deadline, code quality decreases
&lt;/h3&gt;

&lt;p&gt;Some times, when you're about to reach a deadline, and there's still a ton of features left to develop, you start saying "SCREW IT" to some of the coding conventions. You start copy/pasting code, completely violating &lt;em&gt;D.R.Y.&lt;/em&gt; principles. Readability? Who cares when there's a deadline approaching? &lt;/p&gt;

&lt;h3&gt;
  
  
  Thanks to pressure, some features get left out
&lt;/h3&gt;

&lt;p&gt;I was giving myself so much pressure, I ended up leaving out a lot of features undeveloped. I know what you're thinking, how did I finish the project if I left out some features? 🤔&lt;/p&gt;

&lt;p&gt;...&lt;/p&gt;

&lt;p&gt;Anyways, I ended up prioritizing some features over others, and hey, who can blame me? 🤷‍♂️&lt;/p&gt;

&lt;h3&gt;
  
  
  Bugs
&lt;/h3&gt;

&lt;p&gt;The only code without bugs ... is code that hasn't been written yet. In reality, every code has bugs, and as you approach a deadline, the pressure makes you to introduce more bugs. Some are noticeable, and some of them you only notice them when in production ... and something is burning.&lt;/p&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;p&gt;What's that?&lt;br&gt;
....&lt;/p&gt;

&lt;p&gt;Just kidding. As you approach the deadline, you stop caring about performance. Of course, the code can be refactored later when all the servers are on fire, the client is yelling, and the users are calling non-stop.&lt;/p&gt;

&lt;p&gt;I know most of these things are probably common, a lot of you have experienced them beforehand. That doesn't mean of course, that there isn't anyone who hasn't.&lt;/p&gt;

&lt;p&gt;Here are some of the screenshots of what the system looks like:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--31KW4yFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/login-page.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--31KW4yFE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/login-page.png" alt="login page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--x9Ac9C1U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/dashboard.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--x9Ac9C1U--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/dashboard.png" alt="dashboard"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gkbW9n-n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/employees-page.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gkbW9n-n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/employees-page.png" alt="employees page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0KCPlbvP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/employee-details-page.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0KCPlbvP--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/kudzaitsapo/hr-manager-ui/main/screenshots/employee-details-page.png" alt="employee details page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Right, I know what you might be thinking ... What's with this guy and HR funny systems? Who knows?&lt;br&gt;
...&lt;br&gt;
Anyways, Just thought I could share what I learnt during the weekend, for the benefit of others who haven't.&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>javascript</category>
      <category>tailwindcss</category>
      <category>react</category>
    </item>
    <item>
      <title>Spring security, CORS and Axios!</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Fri, 12 Mar 2021 15:34:47 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/spring-security-cors-and-axios-2pkc</link>
      <guid>https://dev.to/kudzaitsapo/spring-security-cors-and-axios-2pkc</guid>
      <description>&lt;p&gt;Right, I was happily enjoying my day, doing awesome stuff ( &lt;em&gt;not really&lt;/em&gt; ), when I got a message that my API was causing CORS issues!&lt;/p&gt;

&lt;p&gt;Now, I thought this was weird, considering I &lt;em&gt;had&lt;/em&gt; fixed those issues at the beginning. Last time we faced CORS issues, it was because someone was using an incorrect URL ( &lt;em&gt;which of course didn't exist&lt;/em&gt; ), so the preflight request got a 404 error, resulting in the blasted CORS error.&lt;/p&gt;

&lt;p&gt;Today, I thought it was the same issue. And boy, was I super wrong! After spending the whole day debugging why axios was being a &lt;del&gt;bitch&lt;/del&gt; pain-in-the-somewhere, I totally realized something funny was going on. The URL was correct, meaning something else was going on. &lt;/p&gt;

&lt;p&gt;So, what I finally realized was that Spring Security, by default validates &lt;code&gt;OPTIONS&lt;/code&gt; requests, which are sent by Axios in a preflight request. And that's when it hit me, I had forgotten to disable that. 😅&lt;/p&gt;

&lt;p&gt;All I had to do, was to go inside my &lt;code&gt;WebSecurityConfig&lt;/code&gt; class, and inside the &lt;code&gt;configure&lt;/code&gt;, put a &lt;code&gt;http.cors()&lt;/code&gt;. Simple, right? Ah well, give me a break!&lt;/p&gt;

</description>
      <category>java</category>
      <category>mysql</category>
      <category>api</category>
      <category>webdev</category>
    </item>
    <item>
      <title>JPA, MySQL and UUIDs are not friends, apparently...</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Tue, 02 Mar 2021 22:53:36 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/jpa-mysql-and-uuids-are-not-friends-apparently-chn</link>
      <guid>https://dev.to/kudzaitsapo/jpa-mysql-and-uuids-are-not-friends-apparently-chn</guid>
      <description>&lt;p&gt;Today I was being myself as usual, creating an API with a UUID as a primary key. All was well, until JPA decided it wasn't. 😑 &lt;/p&gt;

&lt;p&gt;I had created a OneToOne relationship between one entity, and my User entity ( &lt;em&gt;which had a UUID as Id&lt;/em&gt; ). In my defense ( &lt;em&gt;before you start judging&lt;/em&gt; ) everything was working well. However, I started getting inconsistencies.&lt;/p&gt;

&lt;p&gt;I had a method for retrieving paginated entities, and this method started throwing some &lt;code&gt;EntityNotFound&lt;/code&gt; exception! After some hours of googling what was the problem, I found a work around, which was putting a &lt;code&gt;@NotFound&lt;/code&gt; on the relationship. This is ... eh ... not quite a good idea, so I decided to screw it.&lt;/p&gt;

&lt;p&gt;That's when I discovered the problem was that JPA could handle UUIDs, but MySQL had issues. Apparently, mysql stored UUIDs as binary, and JPA was trying to search using the UUID as a string, and that wasn't working.&lt;/p&gt;

&lt;p&gt;What I didn't get though, was why on one method it was working perfectly, but on another, being inconsistent. If there's anyone who can explain to me WTF caused this issue, please feel free to say something.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mysql</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Spring boot error messages disabled!</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Sun, 28 Feb 2021 22:03:42 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/spring-boot-error-messages-disabled-51j5</link>
      <guid>https://dev.to/kudzaitsapo/spring-boot-error-messages-disabled-51j5</guid>
      <description>&lt;p&gt;So, I went through a lot of hell trying to figure out why the f-word my messages weren't showing. Guess what? Apparently, the are now disabled by default! 😑 &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnnaz2l79pn9zqlvb3475.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnnaz2l79pn9zqlvb3475.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
After spending a few hours wondering why my code wasn't working, I finally stumbled upon the reason. &lt;/p&gt;

&lt;p&gt;Apparently, the default value for server.error.include-message is "never".&lt;/p&gt;

&lt;p&gt;So, I went into my code (application.properties) and had to do the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

server.servlet.context-path=/api/v1
server.error.include-message=always
server.error.include-binding-errors=always


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;...&lt;br&gt;
What's that? It's non-standard, you say?&lt;br&gt;
Well, get off my back! It works, doesn't it?&lt;/p&gt;

&lt;p&gt;In case someone is having the same issue and like me they're wondering wtf is going on, this should be able to help. &lt;/p&gt;

</description>
      <category>java</category>
      <category>api</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Making an HR software with Spring Boot Part V</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Tue, 20 Oct 2020 08:00:37 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-v-172g</link>
      <guid>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-v-172g</guid>
      <description>&lt;p&gt;Now, let's talk about a topic that's &lt;em&gt;not so&lt;/em&gt; near and dear to my heart: relationships 😬. Of course, I'm talking about the only relationships that programmers are really good at ... database relationships!&lt;/p&gt;

&lt;p&gt;Anyway, before we go into that, there's something I forgot to put at the end of the &lt;code&gt;application.properties&lt;/code&gt;. Copy paste this line:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;spring.jpa.database-platform=org.hibernate.dialect.MySQL5Dialect&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I'll not be explaining what this line does (&lt;em&gt;I'm lazy lol&lt;/em&gt;). Now that we're done, let's continue on to relationships... (&lt;em&gt;cough cough&lt;/em&gt;). Right, we know that an &lt;strong&gt;Employee&lt;/strong&gt; has a &lt;strong&gt;Job&lt;/strong&gt;, and is under a &lt;strong&gt;Department&lt;/strong&gt;, is allowed to take many &lt;strong&gt;LeaveDays&lt;/strong&gt;, and can &lt;strong&gt;misbehave&lt;/strong&gt; multiple times. From this alone, we now have our database relationships...&lt;/p&gt;

&lt;p&gt;Open the Employee.java and paste the following code (&lt;em&gt;which of course I won't be explaining...&lt;/em&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="nd"&gt;@OneToOne&lt;/span&gt;
&lt;span class="nd"&gt;@JoinColumn&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"job_id"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Job&lt;/span&gt; &lt;span class="n"&gt;job&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@OneToOne&lt;/span&gt;
&lt;span class="nd"&gt;@JoinColumn&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"department_id"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Department&lt;/span&gt; &lt;span class="n"&gt;department&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@ManyToMany&lt;/span&gt;
&lt;span class="nd"&gt;@JoinTable&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"employee_misconducts"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
&lt;span class="n"&gt;joinColumns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;@JoinColumn&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"employee_id"&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
    &lt;span class="n"&gt;inverseJoinColumns&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nd"&gt;@JoinColumn&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"misconduct_id"&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Misconduct&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;misconducts&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@OneToMany&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mappedBy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"employee"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;LeaveDay&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;leaveDays&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;...&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open Job.java and put the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="nd"&gt;@OneToMany&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;...&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you're done with that, put the following code inside LeaveDay.java:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="nd"&gt;@ManyToOne&lt;/span&gt;
&lt;span class="nd"&gt;@JoinColumn&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"employees_ecnumber"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="n"&gt;employee&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Afterwards, put the following code inside Misconduct.java:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="o"&gt;...&lt;/span&gt;

&lt;span class="nd"&gt;@ManyToMany&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;mappedBy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"misconducts"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;List&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Employee&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;employees&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;...&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And with that, we can say we're done-ish. Obviously, there are a lot of things that can be improved, but then again, we're not perfectionists ( &lt;em&gt;I know I'm not!&lt;/em&gt; ). Anyway, in the next tutorial, we are going to finish up on the API by making repositories, controllers and DTOs. Enjoy your day ... or night ... chao 👋&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Making an HR software with Spring Boot Part IV</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Thu, 15 Oct 2020 06:54:14 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-iv-8b8</link>
      <guid>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-iv-8b8</guid>
      <description>&lt;p&gt;Welcome back ...eh ... if you're still following this tutorial. Anyway, I'm going to start by explaining what happened in the last tutorial and why ...ish. &lt;/p&gt;

&lt;p&gt;So, I'll start with explaining the application.properties thing which I told you to do. First the line &lt;code&gt;spring.jpa.hibernate.ddl-auto=update&lt;/code&gt; is a spring configuration which is used by &lt;em&gt;Hibernate&lt;/em&gt; for &lt;em&gt;DDL generation&lt;/em&gt;. I'm not going into more details, since the tutorials would span for 100 parts ... which ... isn't really a good idea. Anyway, &lt;code&gt;spring.datasource.url&lt;/code&gt; is a configuration for specifying the database host, port, name and type. As for the rest of the configs, they're just the database credentials.&lt;/p&gt;

&lt;p&gt;Welp, now we're done with the configs, let's move on to the code. Instead of writing getters and setters for the class, I used Lombok, which does that for me. That's why there are the &lt;code&gt;@Getter&lt;/code&gt; and &lt;code&gt;@Setter&lt;/code&gt; annotations. Again, I'm going to skip the entire explanation for how they work.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;@Entity&lt;/code&gt; annotation is used to tell JPA that we're going to be persisting the Employee objects into the database. In most cases, the name of the table in the database and the name of the entity will not be the same. This is why I used the &lt;code&gt;@Table&lt;/code&gt; annotation, so that I can specify the name of the table. Of course, there are more things I could have specified, but for now, this explanation suffices.&lt;/p&gt;

&lt;p&gt;And then there are the column attributes. Honestly, I'm gonna skip explaining those because I feel like I'm running out of space.&lt;/p&gt;

&lt;p&gt;Now, let's go back to work. Where was I? Right, we have the employee model defined. Let's define the rest of them. For the record, I'm going to be posting the code here ... if you have any questions, I'm sure you can post them in the comments. Now, the Project Manager is angry because he believes you're wasting time. So, let's get back to work!!&lt;/p&gt;

&lt;p&gt;First, we'll start with jobs ... So, create a file under models, with the name Job.java and paste the following code ...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.dull.piqued.models&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Getter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Setter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.CreationTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.UpdateTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;javax.persistence.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Date&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Getter&lt;/span&gt;
&lt;span class="nd"&gt;@Setter&lt;/span&gt;
&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="nd"&gt;@Table&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"jobs"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Job&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Id&lt;/span&gt;
    &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GenerationType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;AUTO&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;minSalary&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;maxSalary&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@CreationTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;createdAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@UpdateTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;updatedAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the Job model, we have the Department model.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.dull.piqued.models&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Getter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Setter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.CreationTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.UpdateTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;javax.persistence.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Date&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Getter&lt;/span&gt;
&lt;span class="nd"&gt;@Setter&lt;/span&gt;
&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="nd"&gt;@Table&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"departments"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Department&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Id&lt;/span&gt;
    &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GenerationType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;AUTO&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;departmentId&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@CreationTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;createdAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@UpdateTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;updatedAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And then leave days:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.dull.piqued.models&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Getter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Setter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.CreationTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.UpdateTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;javax.persistence.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Date&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Getter&lt;/span&gt;
&lt;span class="nd"&gt;@Setter&lt;/span&gt;
&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="nd"&gt;@Table&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"leave_days"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;LeaveDay&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Id&lt;/span&gt;
    &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GenerationType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;AUTO&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;startDate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;endDate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;dateApproved&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;leaveType&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;leaveStatus&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@CreationTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;createdAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@UpdateTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;updatedAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Following that, we have misconducts. Remember, HR is supposed to record all misconducts that an employee does, and then if they are suspended for eternity, that is supposed to be recorded as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.dull.piqued.models&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Getter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Setter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.CreationTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.UpdateTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;javax.persistence.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Date&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Getter&lt;/span&gt;
&lt;span class="nd"&gt;@Setter&lt;/span&gt;
&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="nd"&gt;@Table&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"misconducts"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Misconduct&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;

    &lt;span class="nd"&gt;@Id&lt;/span&gt;
    &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GenerationType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;AUTO&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;dateOccurred&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;punishment&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;punishmentDate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@CreationTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;createdAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@UpdateTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;updatedAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I know the punishment could probably have gone into a different model, but since I'm too lazy to do that, we'll leave it there ... Now that we are done with the models, we are now going to be implementing relationships 😬 in the next tutorial ... chao 👋&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Making an HR software with Spring Boot Part III</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Mon, 12 Oct 2020 14:04:49 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-iii-2f42</link>
      <guid>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-iii-2f42</guid>
      <description>&lt;p&gt;Right, now we have managed to come up with a database of sorts. What we need to do is to initiate the project, and implement the database, correct? So, we'll head over to &lt;a href="https://start.spring.io"&gt;start.spring.io&lt;/a&gt; to initialize our project.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qktIYWqt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hv7z9dp0ur309cg0618y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qktIYWqt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hv7z9dp0ur309cg0618y.png" alt="Image goes here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me say something in a bit. &lt;br&gt;
First off, I really don't like gradle so I'll use maven instead. Another thing, please do pay attention to the java version down there. Use Java 8, it works ...&lt;/p&gt;

&lt;p&gt;After clicking generate, the project should be downloaded as a zip file. Open the project using your favorite editor ( &lt;em&gt;mine is intellij idea&lt;/em&gt; )&lt;/p&gt;

&lt;p&gt;The project should like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--3tQKdYws--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zehu9qhvs1m5pgil6kq6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--3tQKdYws--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zehu9qhvs1m5pgil6kq6.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last time I had an argument of sorts with a workmate/acquaintance of mine over project folder structures. To be fairly honest, at the end of the day, it depends on your preference. If you feel like my folder structure is weird ... then good for you!&lt;/p&gt;

&lt;p&gt;Anyway, I normally use the following structure:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nueGth1f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1s37585r6qhfm9sb2vef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nueGth1f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1s37585r6qhfm9sb2vef.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love this structure because it creates a separation of concerns. Models have their own folder, DTOs have their own folder and controllers have their own folders ... and so on. Like I said earlier, it's just a matter of preference.&lt;/p&gt;

&lt;p&gt;Anyway, stupid things aside, now we are going to be implementing the models. First, we'll start with the Employee model. Java is object oriented, which means that everything is an object ... eh ... I'm sure you understand.&lt;/p&gt;

&lt;p&gt;To be honest, I'm very lazy. As most lazy people do, I'm going to use lombok instead of defining getters and setters manually.&lt;/p&gt;

&lt;p&gt;Anyway, before we get into that, we need to open the application.properties under src &amp;gt; main &amp;gt; resources and put the database configurations there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wUQFMMHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c73afqxra4ususofq2yt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wUQFMMHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/c73afqxra4ususofq2yt.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When done with that, let's get into defining the model. Under the models package, create a new file called Employee.java. The initial code, before defining the relationships, looks like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight java"&gt;&lt;code&gt;
&lt;span class="kn"&gt;package&lt;/span&gt; &lt;span class="nn"&gt;com.dull.piqued.models&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Getter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;lombok.Setter&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.CreationTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;org.hibernate.annotations.UpdateTimestamp&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;javax.persistence.*&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;java.util.Date&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@Getter&lt;/span&gt;
&lt;span class="nd"&gt;@Setter&lt;/span&gt;
&lt;span class="nd"&gt;@Entity&lt;/span&gt;
&lt;span class="nd"&gt;@Table&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"employees"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;public&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Employee&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nd"&gt;@Id&lt;/span&gt;
    &lt;span class="nd"&gt;@GeneratedValue&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;strategy&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GenerationType&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;AUTO&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;updatable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;long&lt;/span&gt; &lt;span class="n"&gt;ecNumber&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;firstname&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;lastname&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unique&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unique&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;phone&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;String&lt;/span&gt; &lt;span class="n"&gt;physicalAddress&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="kt"&gt;double&lt;/span&gt; &lt;span class="n"&gt;salary&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@Column&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;hireDate&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@CreationTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;createdAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;@UpdateTimestamp&lt;/span&gt;
    &lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt; &lt;span class="n"&gt;updatedAt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now, I'll explain what the code does in the next tutorial... chao 👋&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Making an HR software with Spring Boot Part II</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Sun, 11 Oct 2020 10:49:05 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-ii-lfa</link>
      <guid>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-ii-lfa</guid>
      <description>&lt;p&gt;Welcome to the second part of this not really awesome tutorial, on how to make an employee management system in java. In the last tutorial, we decided ... actually, I decided to describe what we are going to be doing, and why ...ish. &lt;/p&gt;

&lt;p&gt;Now, I know I unilaterally decided on the technology stack, so let me go back to that for a bit. The &lt;em&gt;Dull Company&lt;/em&gt; makes underground bunkers for presidents and rich people (&lt;em&gt;umm ... yes&lt;/em&gt;). It has been operational for a few decades, and it employs a a few hundred people. Since &lt;em&gt;Aware&lt;/em&gt; is a Java based software, the new IT Director is convinced that Java is the best language for developing software (&lt;em&gt;don't ask me...&lt;/em&gt;). Therefore, all IT based systems, even the once they have outsourced, are all Java systems. With his bias, he told you to use Java with MySQL, hence the Spring Boot unilateral declaration. Anyway, there are other technology stacks included in the entire package, and these include but are not limited to &lt;em&gt;Elastic Search&lt;/em&gt; and &lt;em&gt;Apache Kafka&lt;/em&gt;, and for DevOps, there's &lt;em&gt;Jenkins&lt;/em&gt;, &lt;em&gt;Docker&lt;/em&gt; and &lt;em&gt;Kubernetes&lt;/em&gt;. However, I will not be covering these technologies in this tutorial series. (&lt;em&gt;Because I'm too lazy lol&lt;/em&gt;) &lt;/p&gt;

&lt;p&gt;So, in this tutorial, we are going to design the database of the system. Actually, scratch that. I'm going to post an already made database design, and I'll try my best to explain how I came up with it. The software I used to make the database design is &lt;a href="https://draw.io"&gt;draw.io&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Of course, the database could be better, and of course, there's a better way of doing things. However, this way works, and it's for educational purposes. Therefore, it'd be nice if someone could give me a break.&lt;/p&gt;

&lt;p&gt;Anyway, continuing with our scenario, as the software engineer, you have managed to sit down with &lt;em&gt;HR&lt;/em&gt;, and they've given you the requirements. The requirements are as vague as they can be, and someone even had the decency to draft a "requirements specification document". Don't ask me who!&lt;/p&gt;

&lt;p&gt;However, you, being smarter than everyone, manage to figure out what the company &lt;em&gt;needs&lt;/em&gt;. And yes, scratch what they want ... (&lt;em&gt;ahem&lt;/em&gt;). So, going through the &lt;em&gt;SRS&lt;/em&gt;, you know that every &lt;em&gt;employee&lt;/em&gt; is &lt;em&gt;under a department&lt;/em&gt;. &lt;em&gt;Each department has a manager&lt;/em&gt;, and this is a &lt;em&gt;job title&lt;/em&gt; given to privileged individuals (&lt;em&gt;ahem&lt;/em&gt;). There are different job titles, for example, you being a Software Engineer, means that is your job title under the IT department.  &lt;/p&gt;

&lt;p&gt;Every employee is entitled to &lt;em&gt;leave days&lt;/em&gt;, and if an employee misbehaves, it must be recorded in the system. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--onSR-6qU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dy15bcp2vt5lh7578n89.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--onSR-6qU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/dy15bcp2vt5lh7578n89.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, above is the diagram I've drawn using draw.io, and that's what we're going to be using for the database. Now that we're done with database design, we're going to start implementing the database in the next tutorials. &lt;/p&gt;

&lt;p&gt;Yes, I know the database diagram can be better, and some parts &lt;em&gt;might&lt;/em&gt; be total BS (&lt;em&gt;ummm&lt;/em&gt;), but then again ... it works! (&lt;em&gt;I know it does&lt;/em&gt;) Let's continue in the next tutorial...&lt;/p&gt;

</description>
      <category>java</category>
      <category>mysql</category>
      <category>springboot</category>
    </item>
    <item>
      <title>Making an HR software with Spring Boot Part I</title>
      <dc:creator>Kudzai Tsapo</dc:creator>
      <pubDate>Sun, 11 Oct 2020 10:38:32 +0000</pubDate>
      <link>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-i-3f16</link>
      <guid>https://dev.to/kudzaitsapo/making-an-hr-software-with-spring-boot-part-i-3f16</guid>
      <description>&lt;p&gt;So, this other day I decided to start learning Spring Boot, and I really grew to despise the todo list tutorials people made. Of course, for beginners, they are okay. But when you're done, the question will be now what?  Hey, at least you know how to make a todo list, right?&lt;/p&gt;

&lt;p&gt;We are going to be making an employee management system. Why you ask? Just because! &lt;/p&gt;

&lt;p&gt;Anyway, using Spring Boot with MySQL, we are going to build an employee management system.  This system will be for managing employees and their leave days, salaries and all of that nonsense.  It's also going to be keeping track of all their suspensions, misconducts ... etc. &lt;/p&gt;

&lt;p&gt;The technologies we are going to use include but are not limited to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Java (Spring Boot) for the API&lt;/li&gt;
&lt;li&gt;MySQL (Database)&lt;/li&gt;
&lt;li&gt;VueJs (for the front-end dashboard)&lt;/li&gt;
&lt;li&gt;Probably Bootstrap for the UI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Who is this tutorial for? I don't know! I just decided to make a tutorial to show how awesome I am ... or maybe how terrible I am at software development. It's up to you to pick one at the end. By the way, I'm a complete noob when it comes to Vue, so if you know a better way of doing things ...eh ... good for you!&lt;/p&gt;

&lt;p&gt;For the lazy ones, the code is available on github, &lt;a href="https://github.com/kudzaitsapo/piqued"&gt;here&lt;/a&gt;.  And if you see the code incomplete, then hold your horses... it's still a work in progress after all. &lt;/p&gt;

&lt;p&gt;So, where do we begin? &lt;/p&gt;

&lt;p&gt;First, we'll start by describing a scenario. What problem are we solving, and why? (&lt;em&gt;the why might be a little fuzzy but hey...at least it's there&lt;/em&gt;) By the way, all names specified in the scenario are purely fictional (&lt;em&gt;I made them up&lt;/em&gt;), and any resemblance to actual people and organizations is purely coincidental (&lt;em&gt;it wasn't planned!&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Congratulations, you've managed to land a job as a &lt;strong&gt;software&lt;/strong&gt; engineer at the &lt;strong&gt;Dull Company (Pvt) Ltd&lt;/strong&gt;. Now, before you came along, the Dull Company was spending millions of dollars annually on a crappy outsourced software called &lt;strong&gt;Aware&lt;/strong&gt;. The system didn't work 99% of the time, and when it did, it was mostly due to a bug. However, because it was recommended by a previous manager, the company stuck with it. The  CEO was outraged when he realized that they were spending that much money on a stupid, non-working program. Being the genius that he's not, he told the company to hire a software engineer to develop and manage internal systems. This is where you come in.&lt;/p&gt;

&lt;p&gt;We are not going into the details of how you got the job, but after you come in, your first project is to develop a system for managing employees. This software is supposed to replace &lt;strong&gt;Aware&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Now, we are not going to go through the entire SDLC, and of course we are going to assume that you're given all the requirements. (&lt;em&gt;Don't ask me why?&lt;/em&gt;) Anyway, we are going to jump in head first and develop the darn system for Dull Company (Pvt) Ltd. The first thing we are going to do is to design the database, and we are going to do this in the next article. So, go ahead and prepare your mind, it's going to be a long journey ahead.&lt;/p&gt;

</description>
      <category>java</category>
      <category>mysql</category>
    </item>
  </channel>
</rss>
