[hibernate-dev] Strange sequence effect with ORM 5

Sanne Grinovero sanne at hibernate.org
Fri Aug 21 11:25:44 EDT 2015


Ok, thanks and sorry I missed this :)
I was aware that it would switch to sequences rather than identity,
but I missed that there would be a single Sequence shared among
types... I still find that a bit surprising as I would expect to
generally want different sequences for each type.

Thanks,
Sanne

On 21 August 2015 at 16:21, Steve Ebersole <steve at hibernate.org> wrote:
> Please see the migration guide and/or blogs :)
>
> Yes, we changed the default mapping for how id generators are mapped as
> discussed extensively on the mail list last month or earlier this month.
> Essentially we changed the default for `hibernate.id.new_generator_mappings`
> from false to true for 5.0.  For H2, the old mapping would have been an
> IDENTITY column.  The "new" mapping is the SequenceStyleGenerator.
>
>
>
> On Fri, Aug 21, 2015 at 10:16 AM Sanne Grinovero <sanne at hibernate.org>
> wrote:
>>
>> Hi all,
>> after upgrading Hibernate Search to Hibernate ORM 5.0.0.Final we
>> noticed a small change in behaviour in sequences.
>>
>> In a single test we persist two entities of differnent types, Country
>> and Address, and both types have the id mapped as follows:
>>
>>    @Id
>>    @GeneratedValue
>>    Long id;
>>
>> Previously, when running on H2, the IDs assigned to these two entities
>> would be respectively 1 and 1.
>> When upgrading ORM from 5.0.0.CR3 to 5.0.0.Final, the assigned ids are
>> now 1 and 2.
>>
>> Are sequences now being shared by default across unrelated entities?
>> Is this the new intended default?
>>
>> Thanks,
>> Sanne
>> _______________________________________________
>> hibernate-dev mailing list
>> hibernate-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/hibernate-dev


More information about the hibernate-dev mailing list