Hi! 

I am a quite new jOOQ user and I would appreciate a little help.
I have 2 mysql tables ("logs" and "datasets") that both use as a primary 
key a field named "id" with AUTO_INCREMENT as default value.

<https://lh3.googleusercontent.com/-zWEAnwqRUEU/VXAjbOrYkiI/AAAAAAAAABA/yz9QOz6wlA0/s1600/logs.png>

<https://lh3.googleusercontent.com/-IRFb-r5s9rs/VXAjdywPm4I/AAAAAAAAABI/M57y61-e1_Q/s1600/datasets.png>


I generate all the required files for jOOQ and then try to store records in 
these 2 tables.

Storing a record to the first table works fine:

DSLContext database = DSL.using(this.conn, SQLDialect.MYSQL);  
LogsRecord logItem = database.newRecord(Tables.LOGS);
logItem.setUserEmail(user_email);
logItem.setAction(action);
logItem.setMessage(message);
logItem.store();  

Storing to the second table:

DSLContext database = DSL.using(this.conn, SQLDialect.MYSQL);  
DatasetsRecord record = database.newRecord(Tables.DATASETS);
record.setUserEmail(user_email);
record.setName(datasetName);
record.store();  

raises an Exception with the following messsage:

SQL [insert into `metacatalogue`.`datasets` (`name`, `user_email`) values 
(?, ?)]; Field 'id' doesn't have a default value

I am really confused! What is going wrong here?

Alexandros

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to