hibernate exception on saveOrUpdate
<p>I'm having an strange problem when I try to save or update a simple entity:</p>

<pre><code>   @Entity
public class TimeTable {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @OneToMany(fetch = FetchType.EAGER, orphanRemoval = false, targetEntity = Subject.class)
    private Set&lt;Subject&gt; courses = new HashSet&lt;Subject&gt;();


@Entity
public class Subject {

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    @Column(nullable = false, unique = true)
    private String name;
    @Column(nullable = false)
    private boolean mandatory = false;

    @Column(nullable = false)
    private Integer credits;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true, targetEntity = Period.class)
    private Set&lt;Period&gt; periods = new HashSet&lt;Period&gt;();
</code></pre>

<p>`the DAO class</p>

<pre><code>public synchronized void saveOrUpdate(E obj) {

    log.log(Level.DEBUG, "iniciando save de " + obj.toString());
    Session s = this.getSession();
    s.beginTransaction();
    s.saveOrUpdate(obj);
    try {
        s.getTransaction().commit();
    } catch (Exception e) {
        s.getTransaction().rollback();
        e.printStackTrace();
    }
    s.close();

    log.log(Level.DEBUG, "save concluido com sucesso");

}
</code></pre>

<p>and my test code:</p>

<pre><code>GenericDAO&lt;TimeTable&gt; asd = new GenericDAO&lt;TimeTable&gt;(TimeTable.class);
GenericDAO&lt;Subject&gt; qwe = new GenericDAO&lt;Subject&gt;(Subject.class);
Set&lt;Subject&gt; aasdasd = new HashSet&lt;Subject&gt;();
aasdasd.addAll(qwe.findAll());
TimeTable zxc = new TimeTable(aasdasd);
asd.saveOrUpdate(zxc);
</code></pre>

<p>but i'm getting exception on saveOrUpdate line:</p>

<pre><code>Caused by: java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (near ")": syntax error)
    at org.sqlite.core.DB.newSQLException(DB.java:890)
Exception in thread "main" org.hibernate.exception.GenericJDBCException: [SQLITE_ERROR] SQL error or missing database (near ")": syntax error)
    at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:52)
</code></pre>

<p>the exception point to the line s.saveOrUpdate(obj); in my dao class, but it doens't happen when i try to do exactly the same thing with other entities [even more complex].</p>

<p>Does anybody has any tip about it?</p>