← Back to team overview

dhis2-devs team mailing list archive

Re: dhis lite

 

>
> That's good news.  BTW I forgot to attach the patch.  I think there's
> still a few things to do around the jdbc module for derby, but that
> looks like mostly cut and paste stuff (unless my sources are not quite
> up to date).  Otherwise I think we're nearly there ...
>


Things now run fine with derby regarding normal Hibernate operations.

For the "jdbc component" I struggle with generating identifiers for primary
keys in SQL insert statements. The standard way to create such an
auto-incremented field would be to add "not null generated always as
identity" to the column list. This would allow you to simply skip this field
in the column/values part in the sql insert statement and let derby generate
the identifier.

It looks as if Hibernate create tables without this auto-increment feature.
When I run the ij tool and describe tables, the id column has column_def =
"NULL", while tables I create manually with auto-increment id get column_def
= "AUTOINCREMENT". Also, running sql statements with the identifier column
left out gives me an error saying that the id column cannot accept a null
value.

Is Hibernate using its hi-lo id generator? It it using some sort of
sequence, like Postgres? I would hate implementing my own id generator for
this.

Follow ups

References