🔒 100% Client-Side Engine • Modern Spring Boot 4 & Hibernate 7

Zero-Custody SQL Schema to Java Entity Generator

Convert proprietary PostgreSQL, MySQL, Oracle, SQL Server, and H2 DDL scripts into production-ready Spring Boot 4, Jakarta Persistence 3.2, and Hibernate 7 entity classes, composite IDs, Spring Data repositories, and Java 21/25 record DTOs. Completely offline in your browser — zero tracking, zero server custody.

Zero-Custody: 100% client-side SQL DDL tokenization & Spring Boot 4 / Hibernate 7 generation. Zero bytes leave your browser.
Presets:
pkg:
SQL DDL Schema
3 tables • 22 cols33 lines
Generated Java Files10 files
1package com.example.domain.entity;
2
3import jakarta.persistence.Column;
4import jakarta.persistence.Entity;
5import jakarta.persistence.EntityListeners;
6import jakarta.persistence.GeneratedValue;
7import jakarta.persistence.GenerationType;
8import jakarta.persistence.Id;
9import jakarta.persistence.Table;
10import jakarta.validation.constraints.NotNull;
11import jakarta.validation.constraints.Size;
12
13import org.hibernate.annotations.JdbcTypeCode;
14import org.hibernate.proxy.HibernateProxy;
15import org.hibernate.type.SqlTypes;
16import org.jspecify.annotations.Nullable;
17import org.springframework.data.annotation.CreatedDate;
18import org.springframework.data.annotation.LastModifiedDate;
19import org.springframework.data.jpa.domain.support.AuditingEntityListener;
20
21import java.time.Instant;
22import java.util.Map;
23import java.util.Objects;
24import java.util.UUID;
25
26import lombok.AllArgsConstructor;
27import lombok.Builder;
28import lombok.Getter;
29import lombok.NoArgsConstructor;
30import lombok.Setter;
31
32@Entity
33@Table(name = "customers")
34@EntityListeners(AuditingEntityListener.class)
35@Getter
36@Setter
37@NoArgsConstructor
38@AllArgsConstructor
39@Builder
40public class Customer {
41
42 @Id
43 @GeneratedValue(strategy = GenerationType.UUID)
44 @Column(name = "id")
45 private UUID id;
46
47 @NotNull
48 @Size(max = )
49 @Column(name = "email", nullable = false, unique = true)
50 private String email;
51
52 @NotNull
53 @Size(max = )
54 @Column(name = "full_name", nullable = false, length = )
55 private String fullName;
56
57 @Nullable
58 @JdbcTypeCode(SqlTypes.JSON)
59 @Column(name = "metadata", columnDefinition = "jsonb")
60 private Map<String, Object> metadata;
61
62 @CreatedDate
63 @NotNull
64 @Column(name = "created_at", nullable = false)
65 private Instant createdAt;
66
67 @LastModifiedDate
68 @NotNull
69 @Column(name = "updated_at", nullable = false)
70 private Instant updatedAt;
71
72
73 @Override
74 public boolean equals(Object o) {
75 if (this == o) return true;
76 if (o == null || getClass() != getEffectiveClass(o)) return false;
77 Customer that = (Customer) o;
78 return getId() != null && Objects.equals(getId(), that.getId());
79 }
80
81 @Override
82 public int hashCode() {
83 return getClass().hashCode();
84 }
85
86 private static Class<?> getEffectiveClass(Object o) {
87 return o instanceof HibernateProxy ? ((HibernateProxy) o).getHibernateLazyInitializer().getPersistentClass() : o.getClass();
88 }
89}
90

Enterprise JPA & Schema Diagnostics

3 diagnostic findings
JPA-TEXT-LOBcustomers.metadata

Column "metadata" has unbounded or large payload type (JSONB).

↳ Hibernate 7 @JdbcTypeCode(SqlTypes.JSON) mapping will be generated for native JSON/JSONB binding.

JPA-TEXT-LOBorders.shipping_address

Column "shipping_address" has unbounded or large payload type (JSONB).

↳ Hibernate 7 @JdbcTypeCode(SqlTypes.JSON) mapping will be generated for native JSON/JSONB binding.

JPA-COMPOSITE-PKorder_items

Table "order_items" declares a composite primary key (order_id, product_id).

↳ A companion @Embeddable ID class with Serializable and proxy-safe equals/hashCode will be generated and referenced with @EmbeddedId.

Architectural Standard: Why Lombok @Data is Never Used on JPA Entities

Lombok's @Data automatically creates an equals(), hashCode(), and toString() that evaluates every field. In Hibernate, evaluating lazy collections triggers inadvertent LazyInitializationException, memory-heavy queries, or infinite recursive loops on bi-directional relationships. Furthermore, mutating fields alters the hash code, corrupting Java Set collections. This generator strictly emits explicit, proxy-safe identifier equality.

Production-Grade JPA Architecture: Why Code Generation Must Be Opinionated

Generating JPA entity classes from SQL database DDL requires far more than mechanical keyword substitution. In high-concurrency enterprise applications running Spring Boot 3 or Spring Boot 4, naive entity mapping causes catastrophic runtime bugs: IEEE-754 floating-point financial drift, accidental Cartesian product queries, lazy-loading proxy failures, and corrupted hash collection state.

This zero-custody generator runs 100% in local browser memory using a pure TypeScript SQL parser. It strictly bakes in modern Spring Data and Hibernate 7 enterprise standards to ensure that generated Java code is directly committable to production codebases.

1. Five Architectural Guardrails Baked Into the Generator

Strict Avoidance of Lombok @Data on @Entity

Lombok's @Data synthesizes equals(), hashCode(), and toString() methods across all fields. Reading lazy associations triggers unexpected LazyInitializationException queries or infinite loops on bi-directional relationships. Mutating field values changes the computed hash code, breaking Java Set contracts. This generator strictly emits @Getter, @Setter, @NoArgsConstructor, @AllArgsConstructor, @Builder, and explicit proxy-safe identifier equality.

Mandatory FetchType.LAZY on All @ManyToOne

JPA defaults @ManyToOne and @OneToOne to FetchType.EAGER. In large tables, eager loading triggers cascading N+1 query storms and unintentional multi-table Cartesian joins. This generator mandates fetch = FetchType.LAZY on all foreign-key relationships.

BigDecimal for Financial Precision

Columns named price, amount, balance, or total are mapped to java.math.BigDecimal with explicit precision and scale in @Column. Floating-point types (FLOAT, DOUBLE) introduce binary IEEE-754 precision drift unacceptable in financial ledgers.

Native Hibernate 7 JSONB Binding

Rather than relying on outdated third-party type libraries (like vladmihalcea hypersistence-utils), Hibernate 6 and 7 provide native JSON mapping using @JdbcTypeCode(SqlTypes.JSON) and @Column(columnDefinition = "jsonb") bound to Map<String, Object>.

2. SQL-to-Java Type Mapping Reference (Java 21/25 & Hibernate 7)

The table below illustrates how the generator translates multi-dialect SQL datatypes into modern, type-safe Java 21+ representations:

SQL Data Type (PG / MySQL / Oracle) Java 21/25 Type JPA / Hibernate 7 Annotation Architectural Notes
UUID / UNIQUEIDENTIFIER java.util.UUID @Id @GeneratedValue(strategy = GenerationType.UUID) Modern native UUID generation (RFC 4122)
BIGINT / BIGSERIAL / NUMBER(19, 0) Long @Column(name = "...") Boxed Long for nullable foreign keys and autoincrements
DECIMAL(p, s) / NUMERIC(p, s) BigDecimal @Column(precision = p, scale = s) Arbitrary-precision arithmetic for financial ledgers
JSONB / JSON Map<String, Object> @JdbcTypeCode(SqlTypes.JSON) Native Hibernate 7 JSON serialization
TIMESTAMPTZ / TIMESTAMP WITH TIME ZONE Instant @Column(name = "...") UTC epoch timeline instantaneous point
TIMESTAMP / DATETIME LocalDateTime @Column(name = "...") Zone-agnostic wall-clock timestamp
TINYINT(1) / BOOLEAN / BIT(1) Boolean @Column(name = "...") Correctly converts MySQL TINYINT(1) to Boolean
TEXT / CLOB String @Column(columnDefinition = "TEXT") Unbounded UTF-8 character document storage

3. Composite Primary Keys and Spring Data Companion Classes

When a table declares a multi-column primary key (such as junction tables like order_items (order_id, product_id)), JPA specifications require a dedicated identifier class. The generator automatically constructs:

  • An @Embeddable Identifier Class (OrderItemId.java): Implements Serializable with serialVersionUID = 1L and immutable hash/equality semantics.
  • Embedded Wiring (@EmbeddedId): Injects the composite key cleanly into the parent entity.
  • Spring Data JpaRepository<Entity, IdType>: Generates the companion repository interface typed with the correct scalar or composite key class.
  • Java 21/25 Record DTOs (OrderResponse.java): Emits modern, immutable projection records with JSpecify @Nullable annotations for API response decoupling.

🛡️ Zero-Custody Security & Regulatory Compliance

Enterprise database schemas encode sensitive domain models, regulatory compliance constraints (HIPAA, PCI-DSS, GDPR), and intellectual property. Sending internal SQL DDL to remote cloud converter APIs creates significant security risks and potential regulatory exposure.

This tool executes 100% locally in your browser memory. No telemetry, no intermediate proxies, and zero backend compute. You can disconnect your internet connection or inspect browser network DevTools to verify that zero bytes leave your workstation.

Explore Related Zero-Custody Developer Tools