Java Spring

Overview

The Java Spring generator creates standard Spring Boot Entities, Repositories, and REST Controllers.

Configuration

Add "spring" to your back-end in config.json:

{
  "back-end": ["spring"]
}

Generated Structure

The Generator will output the following in the spring/src/main/java/com/example/demo/ directory:

  • model/: Entity classes annotated with JPA annotations.
  • repository/: Interfaces extending JpaRepository.
  • controller/: REST Controllers.

Entity Example

package com.example.demo.model;

import javax.persistence.*;
import lombok.Data;

@Entity
@Data
@Table(name = "user")
public class User {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String name;
}

Controller Example

package com.example.demo.controller;

import org.springframework.web.bind.annotation.*;
// ...

@RestController
@RequestMapping("/api/user")
public class UserController {
    // Standard CRUD endpoints
}