Java Spring

`the_spring` is an early set of Java helpers. Spring generation is planned but not usable yet.

the_spring

The package is com.puneetxp.lib, under src/main/java/com/puneetxp/lib/:

ClassContents
ModelAn abstract base with a nested DB interface (rawSql, setPlaceholders, many) and join(...).
SqlBuilderBuilds LEFT JOIN queries.
Authhash (SHA-256). login and register are placeholders.
SessionA static map. In a real app, use HttpSession instead.
ResponseWraps output as { "data": … }.
FileActSaves Spring MultipartFile uploads.
MailA stub.

There is no pom.xml or build.gradle yet, and DB has no implementation.

What generation would produce

The dormant generator (compile-php/src/Class/javaspringset.php) writes to spring/src/main/java/com/example/demo/:

  • model/<Name>.java: a JPA @Entity with Lombok @Data, and @Id @GeneratedValue on id;
  • repository/<Name>Repository.java: extends JpaRepository<Name, Long>;
  • controller/<Name>Controller.java: @RestController @RequestMapping("/api/<name>") with repository-backed CRUD.

The entities import javax.persistence. Spring Boot 3 requires jakarta.persistence, so the generator needs that update before its output will compile.