Code Monkey home page Code Monkey logo

bakery's Introduction

Hi there, I'm Luis Enrique - aka GigaByte ๐Ÿ‘‹

Hello, folks!

My name is Luis E and I'm a software developer/DevOps engineer. I'm from Mexico, living in Sunnyvale, California and currently working at Walmart Labs.

โœ Blog & Writing

Apart from coding, I also maintain a blog - you can find my articles on my website at TOBE Defined as well as on Medium and DEV.to.

๐Ÿ”ง Technologies & Tools



๐Ÿ“• Latest Blog Posts

โžก๏ธ more blog posts...


Luis's github stats
Top Langs

bakery's People

Contributors

darklatiz avatar

Watchers

 avatar  avatar

bakery's Issues

Create ER Model for Cart

We are going to create an ER Model for Cart Service

  • ER Model
  • Entity Model
  • Update Flyway Scripts

4. Configure Migrations

Configure migrations

Your new created test for JPA service is failing. It is because there are no required tables in the database, so it is time to define database schema. The reference implementation uses Flyway to automatically manage database schema. It is a very common and good practice to use any sort of schema management in the application.

  • Add flyway-core dependency (using https://start.spring.io and โ€œExploreโ€ button if youโ€™d like)
  • Write a SQL script to create a table with the required fields, using information about entities you defined at step 2.4. Think about the primary key, is there anything in the catalog item you can use?
  • Now add this script as a Flyway migration, see this page for more details.

Your test for database-backed service created at step 2.4 should now work and the whole test suite should pass.

Resources

3. Create a Database connected service

Create a database-connected service

Spring boot JPA tests docs

Pick a right test autoconfiguration for a data JPA test
Create a new service that implements interface from step 2.2, using Spring Data repository
Now create write a test for the new service. Note that your entities (used by repository) and domain classes (used by the service) are different and service should map them.

Think why separation of database models (entities) and domain models is important? Also decide pick the right visibility level classes, which of them should be public and which private?

Your new create test should fail with an exception - there is no database schema defined yet. However now when you have all the entities defined, you can easily design your schema. Weโ€™ll do it on the next step, leave the test failing for now.

Note that you donโ€™t need to configure database connectivity in the test, Spring Boot does that for you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.