davidjanmercado / sqlite-jdbc

Automatically exported from code.google.com/p/sqlite-jdbc
Apache License 2.0
0 stars 0 forks source link

SQL error or missing database (no such table: SEQUENCE) #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
sqlite_sequence - in db table name

[EL Warning]: 2012-07-14 11:59:25.692--ClientSession(1148505631)--Exception 
[EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): 
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing 
database (no such table: SEQUENCE)

- sequenceName="sqlite_sequence",name="comingsofinvoicesongoods" - I try 
changed places ... nothing
    @Id
    @Basic(optional = false)
    @SequenceGenerator(sequenceName="sqlite_sequence",name="comingsofinvoicesongoods")
    @GeneratedValue(generator="sqlite_sequence", strategy=GenerationType.AUTO)
    //@GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

Original issue reported on code.google.com by sp.titan on 14 Jul 2012 at 9:04

GoogleCodeExporter commented 8 years ago
I have same exception, but my POJO is mapped a bit different:

@Entity
@Table(name = "extrato_lancamento")
@EntitySetup(findAllQuery = "select e from ExtratoLancamento e order by e.data, 
e.id", findByIdQuery = "select e from ExtratoLancamento e where e.id=:id", 
idFieldName = "id")
public class ExtratoLancamento {

    @Id
    @GeneratedValue
    private Integer id;

@EntitySetup is my program's annotation, so I think this could be ignorated.

I think I solved this problem running this on sqlite file:

CREATE TABLE sequence (seq_name text, seq_count integer);
insert into sequence (seq_name, seq_count) values ('SEQ_GEN', 10000);

I put 10000 at second command because I'm working on a database with 
preexisting data. I think on a empty database it could be 0, but I not tested 
yet.

Original comment by rmoni...@gmail.com on 25 Sep 2012 at 10:15

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
You managed to solve the problem of this Exception?
Because I'm having the same error here

Original comment by a12...@bcc.unifal-mg.edu.br on 13 Jan 2014 at 11:19

GoogleCodeExporter commented 8 years ago
Yes! Theres some time I did this, but I think that query I post can solve this 
problem.

Original comment by rmoni...@gmail.com on 14 Jan 2014 at 4:22