GithubHelp home page GithubHelp logo

josuerv99 / cx-annotation-processor Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 179 KB

A Java annotation processor that generates a full REST API, handling entity persistence using Spring, Javapoet, JDBC, etc

License: MIT License

Java 99.67% HTML 0.33%
annotation-processor generated-code rest-api spring-boot code-express

cx-annotation-processor's Introduction

Code-Xpress-annotation-processor

A Java annotation processor for entity persistence using Spring, using the idea to generate Java code in the compilation time, with CX annotation you will be enabled to create a REST API just annotation simple Java classes, create full APIs without adding new heavy frameworks and using a very straightforward approach

With a class like this, using the CX annotations, the annotation processor will generate a full CRUD RESTful service that be can accesed through <host_url>:<server.port>/CX/{custom-path-for-cx-entity} with GET, POST, PUT, DELETE HTTP requests!

Features:

  • Repository, Service, Controller layers auto-generated
  • Auto table creation
  • Using REST standard for API's
  • JSON response for auto generated controllers
  • Configurable database connection using JDBC
  • Custom API base path
  • Database table creation by CX entities
  • Full CRUD actions by CX entity definition
package com.javatpoint;

import dev.tools.annotationprocessor.core.annotations.CXSpringRestCrudApi;
import dev.tools.annotationprocessor.core.annotations.entity.CXColumn;
import dev.tools.annotationprocessor.core.annotations.entity.CXEntity;
import dev.tools.annotationprocessor.core.annotations.entity.CXId;
import dev.tools.annotationprocessor.core.annotations.entity.types.column.BigInt;
import dev.tools.annotationprocessor.core.annotations.entity.types.column.Int;
import dev.tools.annotationprocessor.core.annotations.entity.types.column.Varchar;
import lombok.Data;

/**
 * CX API entity handling generated by CX Annotation Processor
 * @author josuerv99
 */
@Data
@CXSpringRestCrudApi(path = "/message")
@CXEntity(tableName = "message_demo_01")
public class Message {

    @CXId(generated = true)
    @CXColumn(name = "ID")
    @BigInt
    private Long id;

    @CXColumn(name = "CONTENT")
    @Varchar
    private String content;

    @CXColumn(name = "FROM_CONTACT_NAME")
    @Varchar(length = 200)
    private String from;

    @CXColumn(name = "TO_CONTACT_NAME")
    @Varchar(length = 199)
    private String to;

    @CXColumn(name = "READERS_COUNTER")
    @Int
    private Integer readBy;
}

cx-annotation-processor's People

Contributors

josuerv99 avatar

Watchers

 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.