Hi
I use NHibernate 1.2.0.2003
SQLite ADO 1.0.39.1
MySQL ADO 1.0.3.31712
I have a table 'users', a table 'credential' and a join table 'users_has_credential'.
I have a many-to-many relationship between 'users and' 'credential'.
I made a little test program to create a user, add some credential and save it into a database.
My program writes in MySQL and after in SQLite.
The idgenerator for both user and credential are unsaved-value="any" and <generator class="assigned" />.
I have a session factory for each database, mappping files are common.
The writing in MySQL works fine but the join table in SQLite is not filled. No SQL orders is issued.
Here's the log4j log:
DEBUG NHibernate.SQL - INSERT INTO users (login, sha1_password, salt, nom, prenom, mail, idusers) VALUES (?p0, ?p1, ?p2, ?p3, ?p4, ?p5, ?p6); p0 = 'bill', p1 = '55666646', p2 = '654646646546', p3 = 'Smith', p4 = 'Bill', p5 =
'bill.smith@mydomain.com', p6 = '302'
DEBUG NHibernate.SQL - INSERT INTO credential (libelle_credential, idcredential) VALUES (?p0, ?p1); p0 = 'reader', p1 = '452'
DEBUG NHibernate.SQL - INSERT INTO users_has_credential (users_idusers, credential_idcredential) VALUES (?p0, ?p1); p0 = '302', p1 = '452'
DEBUG NHibernate.SQL - INSERT INTO users (login, sha1_password, salt, nom, prenom, mail, idusers) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6); @p0 = 'bill', @p1 = '55666646', @p2 = '654646646546', @p3 = 'Smith', @p4 = 'Bill', @p5 =
'bill.smith@mydomain.com', @p6 = '302'
DEBUG NHibernate.SQL - INSERT INTO credential (libelle_credential, idcredential) VALUES (@p0, @p1); @p0 = 'reader', @p1 = '452'
As you can see the three first lines are for MySQL and the two last are for SQLite.
No SQL orders for the 'users_has_credential' for the SQLite database.
Does anyone know if SQLite has a problem for a many-to-many relationship ?
Does anyone managed to have SQLite work with a many-to-many relationship ?
Thanks !!!