Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7744861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:52:13+00:00 2026-06-01T09:52:13+00:00

I am using Hibernate to insert a row into a database, I am using

  • 0

I am using Hibernate to insert a row into a database, I am using Visual Paradigm (Enterprise Edition) to generate database tables.

Here are the errors

org.orm.PersistentException: org.hibernate.PropertyValueException:
not-null property references a null or transient value:
com.patientmanagement.model.Patient.visitRecord at
org.orm.PersistentSession.saveOrUpdate(PersistentSession.java:631) at
org.orm.PersistentManager.saveObject(PersistentManager.java:287) at
com.patientmanagement.model.PatientDAO.save(PatientDAO.java:303) at
com.test.InsertData.main(InsertData.java:28) Caused by:
org.hibernate.PropertyValueException: not-null property references a
null or transient value:
com.patientmanagement.model.Patient.visitRecord at
org.hibernate.engine.Nullability.checkNullability(Nullability.java:100)
at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:312)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:210)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:195)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at
org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:687)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:679)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:675)
at org.orm.PersistentSession.saveOrUpdate(PersistentSession.java:629)
… 3 more

And here is the Insert function to test

public class InsertData {
    public static void main(String[]args) throws PersistentException
    {
        PersistentTransaction trans=PatientmanagementPersistentManager.instance().getSession().beginTransaction();
        try
        {
            //create patient instance
            Patient patient=PatientDAO.createPatient();

            //set patients properties
            patient.setName("Markus Rosevelt");
            patient.setRegisterDate(new Date());

            //save patient
            PatientDAO.save(patient);
            trans.commit();
        }catch(Exception e){
            trans.rollback();
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:52:14+00:00Added an answer on June 1, 2026 at 9:52 am

    you might have defined the column visitRecord as NOT NULL on your database and now you are trying to insert a null value on that column, or your mapping is not correct, can you show your mapping and your table definition?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using NHibernate to bulk-insert rows into my database. Because of the amount
I'm trying to insert some new objects into a firebird database using NHibernate. I
I am using Hibernate and getting Exception in thread main org.hibernate.ObjectNotFoundException: No row with
I'm using Hibernate 3.2.1 and database SQLServer2000 while I'm try to insert some data
I need to insert a lot of data in a database using hibernate, i
I am using hibernate. When I try to insert values into my db I
I have a DAO class which I'm using to try select/update/insert with hibernate and
I am using Hibernate in a Java application to access my Database and it
I am using hibernate to insert objects of the class meal in a hsql
I am using hibernate to do mapping to database. But encountered the following error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.