Giter Club home page Giter Club logo

generator-spring-web-pojo-controller's Introduction

generator-spring-web-pojo-controller

Spring Web Scaffolding System for a Collection Pojo based Controller

Setup

Install node:

 $ brew install node 

Install yeoman:

 $ sudo npm install -g yo

Install generator:

 $ sudo npm install -g spring-web-pojo-controller

Using the generator

When running the generator with the following input

$ yo spring-web-pojo-controller
? What's the name of the noun to be modelled? Person
? What's the type (if primitive, use its wrapper class) of the variable used as an identifier in the noun? String
? What is your default Java package name? (com.example.demo)

This generates an set of classes, with a service class that needs implemented with the business logic.

 @Service
 public class PersonService { }

The generator creates a Controller that exposes a collection resource at /persons. The path is derived from the uncapitalized, pluralized, simple class name of the noun class being managed. For example If the Noun is Person the Collection will be people, if the Noun is Ethernet the Collection will be ethernet.

It also exposes an item resource for each of the items managed by the repository under the URI template /people/{id}. Below is the interface operations that represent the CRUD operations that gets created by the tool.

T create(T noun);
ResponseEntity<T> findOne(ID id);
List<T> findAll();
List<T> findPaginated(int page, int size);
T update(T noun);
void delete(ID id);
void deleteAll();

And optionally

List<T> findFiltered(@RequestParam("filter") T' filter)

Build and compile github project

Setup the dependencies

 $ npm install

Build and run the tests

 $ npm test

And then link to you can test it

 $ npm link

And then run it

 $ yo spring-web-pojo-controller

References

generator-spring-web-pojo-controller's People

Contributors

alrighttheresham avatar damianoneill avatar

Watchers

 avatar  avatar  avatar

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.