not-null property references a null Java Origin: Application & API OSI layer 7 · Application Last updated 2 Dec 2026

org.hibernate.PropertyValueException: not-null property references a null or transient value

A field marked non-nullable was null at save time.

Exact message you may see not-null property references a null or transient value
Seen on: Java

Meaning

Hibernate validates @Column(nullable=false) / optional=false before running SQL, so you get this before any database error.

Common causes

  • Required field not set
  • Relationship optional=false but parent missing
  • Wrong entity mapping
  • Builder default not applied

⚡ Quick fix

  1. Set the field before saving
  2. Make the column nullable if appropriate
  3. Validate input earlier with Bean Validation

Detailed fix by platform

JPA

  1. @NotNull @Column(nullable = false) private String email; and validate in the controller

How to diagnose

  1. Field — Which property?
  2. Mapping — nullable?
  3. Input — Validated?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.