Note that there are some explanatory texts on larger screens.

plurals
  1. POJPA 2.0 / EclipseLink and sqlite 3.7.2 - Can't create the tables
    primarykey
    data
    text
    <p>I'd like to use JPA 2.0 with EclipseLink (2.4.0) and sqlite 3.7.2 in a simple Java Swing application.</p> <p>The first thing I have encountered is, that EclipseLink doesn't support sqlite. Here is the output:</p> <blockquote> <p>[EL Info]: 2012-09-18 18:05:42.246--ServerSession(31125695)--EclipseLink, version: Eclipse Persistence Services - 2.4.0.v20120608-r11652</p> <p>[EL Info]: connection: 2012-09-18 18:05:42.352--Not able to detect platform for vendor name [SQLite3]. Defaulting to [org.eclipse.persistence.platform.database.DatabasePlatform]. The database dialect used may not match with the database you are using. Please explicitly provide a platform using property eclipselink.platform.class.name.</p> </blockquote> <p>However, it seems to me, that the configuration works almost fine.</p> <p>But when I have a model with related Entities (i.e. @ManyToOne) the tables can't be created automatically.</p> <blockquote> <p>[EL Warning]: 2012-09-18 18:05:42.629--ServerSession(31125695)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.0.v20120608-r11652): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near "CONSTRAINT": syntax error) Error Code: 0</p> <p>Call: ALTER TABLE blub ADD CONSTRAINT FK_blub_customer_id FOREIGN KEY (customer_id) REFERENCES customer (customer_id)</p> <p>Query: DataModifyQuery(sql="ALTER TABLE blub ADD CONSTRAINT FK_blub_customer_id FOREIGN KEY (customer_id) REFERENCES customer (customer_id)")</p> </blockquote> <p>As you can see, the additional creation of foreign key constraints isn't supported by sqlite.</p> <p>Do you have any idea how to fix the problem?</p> <p>Best regards</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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