mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-10 05:04:52 +00:00
Fix release announcement paragraph about assigned generated ids
This commit is contained in:
parent
fe466ddea8
commit
43f70b7263
@ -146,15 +146,23 @@ delete from Person p where p.association.someAttr = 1
|
||||
|
||||
|
||||
[[manually-assigned-generated-ids]]
|
||||
== Manually Assigned Identifiers with @GeneratedValue
|
||||
== Manually Assigned Identifiers with custom `IdentifierGenerator`s
|
||||
|
||||
Manually assigned identifier values can now be used with `GeneratedValue` identifiers.
|
||||
Manually assigned identifier values can now be used with custom `IdenfierGenerator`s thanks to the new `allowAssignedIdentifiers()` method.
|
||||
|
||||
[source,java]
|
||||
----
|
||||
class MyGenerator implements IdentifierGenerator {
|
||||
...
|
||||
@Override public boolean allowAssignedIdentifiers() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@Entity
|
||||
@GenericGenerator( type = MyGenerator.class, name = "my_generator" )
|
||||
class Book {
|
||||
@Id @GeneratedValue
|
||||
@Id @GeneratedValue( generator = "my_generator" )
|
||||
Integer id;
|
||||
...
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user