Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse

Kakakuona Forum

D

deleter01

@deleter01
About
Posts
1
Topics
1
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Creating DAOs in Spring Boot without using Database
    D deleter01

    Step One : Create Package to make your work standard

    Screenshot from 2024-08-07 10-16-35.png

    Just right click on com.demo.demo then click new -> package

    Step Two: Create Entity or Object
    Into Entity package right click -> new -> Java Class

    Screenshot from 2024-08-07 10-15-53.png
    Note: You will define your attribute based on need as shown bellow,you can also provide get and set method

    Step Three: Create Interface

    Interface, is abstracts the operations on data without knowing the details of the underlying data source.
    Here we will have two method save() and findAll().
    Screenshot from 2024-08-07 10-10-42.png

    Step Four: Create Implementation of Interface

    private List<User> users = new ArrayList<>();
    This line ensures that when the UserImplement class is instantiated, the users variable will be a new, empty ArrayList that can be used to store User objects. This ArrayList will dynamically grow as User objects are added to it.

    Screenshot from 2024-08-07 10-10-20.png

    Step Five: create Service Class for logic implementation

    Screenshot from 2024-08-07 10-43-17.png

    Step Six: Create Controller for end-point implementation

    Screenshot from 2024-08-07 10-09-00.png

    Step Seven: Here is how Function main look like
    Screenshot from 2024-08-07 10-48-13.png

    Testing Our Program I will use postman

    1. Creating User
      Screenshot from 2024-08-07 10-51-28.png

    2. Get Users
      Screenshot from 2024-08-07 10-52-07.png

  • Login

  • Don't have an account? Register

Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups