Re: [h2] Re: hibernate migration an MODE=PostgreSQL

2021-12-02 Thread Evgenij Ryazanov
Hello.

Hibernate produces wrong SQL for H2 because 
H2IdentityColumnSupport.getIdentityInsertString() incorrectly returns 
"null" instead of "default" for a some historic reason.
`getIdentitySelectString() also needs to be updated.

There is a workaround described in another thread, but actually the whole 
H2Dialect may need to be reviewed to support H2 2.0 properly.

Bugtracker of Hibernate ORM is here:
https://hibernate.atlassian.net/browse/HHH

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/d460e788-6bec-4238-bcc7-4e261e8599b4n%40googlegroups.com.


Re: [h2] Re: hibernate migration an MODE=PostgreSQL

2021-12-02 Thread Noel Grandin




On 2021/12/02 9:59 am, Andrea Spacca wrote:


without `MODE=PostgreSQL` and with `org.hibernate.dialect.H2Dialect` I get the 
following error:
```
ERROR: NULL not allowed for column "ID"; SQL statement:
insert into users (id, password, session_id, username) values (null, ?, ?, ?) 
[23502-202]
```



What does the definition for the users table look like? This seems like some 
kind of issue with auto-generated key columns.


with `MODE=PostgreSQL` and `org.hibernate.dialect.PostgreSQL10Dialect` I get 
this one:
```


The "MODE=" stuff is essentially unsupported at this point - none of the 
existing maintainers are interested,
it looks like Hibernate is looking for metadata that H2 doesn't know how to 
emulate.


--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to h2-database+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/h2-database/01eb033e-4879-7c91-ca26-22b0e36c6514%40gmail.com.