Relationship
User has roles, tokens, OTPs, addresses, wallet, orders, favorites, reviews, notifications.
Code generation
Select any normalized entity and generate Spring Boot code using constructor injection, Lombok, Jakarta Validation, JPA, method security, pagination, and exception handling patterns.
package com.company.fooddelivery.entity;
import jakarta.persistence.*;
import lombok.*;
import java.time.Instant;
import java.util.UUID;
/**
* Platform principal for customers, owners, drivers, and admins.
*/
@Entity
@Table(name = "users")
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class User {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
private UUID id;
@Column(name = "created_at", nullable = false)
private Instant createdAt;
@Column(name = "updated_at", nullable = false)
private Instant updatedAt;
@Column(name = "email", nullable = false, unique = true)
private String email;
@Column(name = "password_hash", nullable = false)
private String passwordHash;
@Column(name = "full_name", nullable = false)
private String fullName;
@Column(name = "phone", nullable = true)
private String phone;
@Column(name = "status", nullable = false)
private String status;
}User has roles, tokens, OTPs, addresses, wallet, orders, favorites, reviews, notifications.