sql - JPA, SQlite no such table: SEQUENCE -


i have problem jpa , sqlite.

i have created entity table. generated entity looks like:

    @entity     @table(name="sqlitetesttable")     public class test implements serializable {         private static final long serialversionuid = 1l;          @id           @generatedvalue(strategy=generationtype.identity)         @column(name="id")         private int id;          @column(name="name")         private string name;            public test() {         }         ------     } 

when try persist few test objects following error: (i have executed same code on mysql without problems)

exception in thread "main" local exception stack:  exception [eclipselink-4002] (eclipse persistence services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.databaseexception internal exception: java.sql.sqlexception: no such table: sequence error code: 0 call: update sequence set seq_count = seq_count + ? seq_name = ?     bind => [50, seq_gen_table] query: datamodifyquery(name="seq_gen_table" sql="update sequence set seq_count = seq_count + ? seq_name = ?")     @ org.eclipse.persistence.exceptions.databaseexception.sqlexception(databaseexception.java:333) 

how can solve problem?

identity default table identity not supported in database platform.

for table need have sequence table created. if have elipselink create tables automatically created you, otherwise need create yourself.

if sqlite has identity support, can create own databaseplatform subclass adds identity support.

in general never recommend using identity, not support pre-allocation , lead poor performance.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -