You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow non-primary-key generated fields, e.g. timestamps, counters, etc.
Currently, HibernateD treats `@Generated` as being inseparable from `@Id`,
it is assumed that any generated field is also the primary key.
However, a database table can have non-primary-key columns that are `@Generated`.
For example, a database that keeps track of a timestamp, which is populated
via a DB trigger or a default value, e.g. `now()`, may exist alongside a
separate primary key.
In order to support this kind of data, the assumption that `@Generated` implies
`@Id` needs to be undone. This PR changes the core logic and also adds a basic
test around generated columns to validate schema generation as well as the ability
to insert and update such records.
0 commit comments