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 7500579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:13:57+00:00 2026-05-29T20:13:57+00:00

I can’t seem to figure out what is wrong. While using plays framework CRUD

  • 0

I can’t seem to figure out what is wrong.
While using plays framework CRUD module to insert information into DB (mySql)
(I am using the default module insertion mechanism as shown at http://www.playframework.org/documentation/1.0.1/crud)
I receive the following exception

PersistenceException occured :
org.hibernate.exception.GenericJDBCException: could not insert:
[models.Mail]

In {module:crud}/app/controllers/CRUD.java (around line 152)

             } catch (TemplateNotFoundException e) {
                 render("CRUD/blank.html", type, object);
             }

          } 

  Here -> object._save(); 
          flash.success(play.i18n.Messages.get("crud.created", type.modelName)); 
         if (params.get("_save") != null) { 
             redirect(request.controller + ".list"); 
          } 
          if (params.get("_saveAndAddAnother") != null) { 

         redirect(req

uest.controller + ".blank");

here is my mail entity class:

@Entity
public class Mail extends Model {


   public String title;

   public Date sentAt;
   @OneToMany
   public Set<User> sentTO;
   @OneToMany
   public Set<User> sentBCC;


    public String content;

    @ManyToOne
    public User author;

    public Mail(User author, ... ){

      //more code here
    }

}

controller

package controllers;

/**
 *
 * @author mike
 */
public class Mails extends CRUD{

}

[full stack]

Execution exception (In {module:crud}/app/controllers/CRUD.java around
line 152) PersistenceException occured :
org.hibernate.exception.GenericJDBCException: could not insert:
[models.Mail]

play.exceptions.JavaExecutionException:
org.hibernate.exception.GenericJDBCException: could not insert:
[models.Mail] at
play.mvc.ActionInvoker.invoke(ActionInvoker.java:231) at
Invocation.HTTP Request(Play!) Caused by:
javax.persistence.PersistenceException:
org.hibernate.exception.GenericJDBCException: could not insert:
[models.Mail] at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214)
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147)
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1153)
at
org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:678)
at play.db.jpa.JPABase._save(JPABase.java:25) at
controllers.CRUD.create(CRUD.java:152) at
play.mvc.ActionInvoker.invokeWithContinuation(ActionInvoker.java:548)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:502) at
play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:478)
at
play.mvc.ActionInvoker.invokeControllerMethod(ActionInvoker.java:473)
at play.mvc.ActionInvoker.invoke(ActionInvoker.java:161) … 1 more
Caused by: org.hibernate.exception.GenericJDBCException: could not
insert: [models.Mail] at
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)
at
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)
at
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:64)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2345)
at
org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2852)
at
org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:71)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:273) at
org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:320)
at
org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:203)
at
org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:129)
at
org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:69)
at
org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:179)
at
org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135)
at
org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:808)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:782) at
org.hibernate.impl.SessionImpl.persist(SessionImpl.java:786) at
org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:672)
… 8 more Caused by: java.sql.SQLException: Field ‘isAdmin’ doesn’t
have a default value at
com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) at
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) at
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) at
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) at
com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2111)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2407)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2325)
at
com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:2310)
at
org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:94)
at
org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:57)
… 23 more

any ideas?

  • 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-05-29T20:13:59+00:00Added an answer on May 29, 2026 at 8:13 pm

    See the actual cause

    Caused by: java.sql.SQLException: Field 'isAdmin' doesn't have a default value
    

    Looks like you’re trying to save into a row without setting the isAdmin property (which is also not defined in your model, but might be in your actual database?).

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

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Can't figure out how to do this in a pretty way : I have
Can you tell me what is the difference between abstraction and information hiding in
Can you suggest some good MVC framework for perl -- one I am aware
Can PHP PDO extension bind nested objects automatically ? I mean using foreign key
Can't work out a way to make an array of buttons in android. This
Can anyone help me trying to find out why this doesn't work. The brushes
Can we close all known/unknown connections to database with the code? I'm using Access
Can't seem to get the Back Button to appear in a UINavigationController flow. I
Can I convert a pdf to pcl file with ghostscript? I'm using Ghostscript 9.01

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.