Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think the error:</p> <blockquote> <p><strong>PersistenceException occured</strong> : <code>org.hibernate.HibernateException</code>: The database returned no natively generated identity value</p> </blockquote> <p>is occurred because there is <strong>no sequence</strong> in your database. If you extends <code>Model</code> class for your model and you are on <strong>Development</strong> mode, Play!Framework automatically generated sequence on your database named <code>hibernate_sequence</code>. The sequence is used to generated <strong>ID</strong> for your model. You may check your database to ensure that sequence is present.</p> <p>If the <code>hibernate_sequence</code> is present, you can insert data like you do before :</p> <pre><code>Notificacion notificacion = new Notificacion( filasConfiguracionClientes.get(i).imeiadmin,imei, "bateria baja" ).save(); </code></pre> <p>then, the error above should be resolved.</p> <hr> <blockquote> <h3>Note:</h3> <blockquote> <p>I am referring this answer if you used <strong>PostgreSQL</strong> database. If you use other database such as <strong>MySQL</strong>, you should define <code>AUTO_INCREMENT</code> on ID column as the sequence definition.</p> </blockquote> </blockquote> <hr> <h3>Update - I have tried this for H2 DB setting</h3> <p>Using <code>H2</code> database as configure in <code>application.conf</code> :</p> <pre><code># Development mode application.mode=dev # Set simple file written database (H2 file stored) db=fs # JPA DDL update for development purpose only jpa.ddl=update </code></pre> <h3>The controller :</h3> <pre><code>public static void test15878866() { // force to insert dummy data Notificacion notificacion = new Notificacion( 1L, 2L, "This is new notificacion" ).save(); renderText(notificacion.detalleNotificacion); } </code></pre> <h3>The model :</h3> <pre><code>@Entity public class Notificacion extends Model { public long imeiadmin; public long imeiclient; public String detalleNotificacion; public Notificacion(long imeiadmin, long imeiclient,String detalleNotificacion) { this.imeiadmin = imeiadmin; this.imeiclient = imeiclient; this.detalleNotificacion = detalleNotificacion; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload