-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: native generator in hibernate 5.2.7 ignores sequence name
PostPosted: Thu Feb 02, 2017 1:10 pm 
Newbie

Joined: Wed Aug 15, 2012 8:41 am
Posts: 3
I am trying to upgrade to hibernate 5.2.7 from hibernate 4.3.
I am using xml mapping files.
My sqlserver and db2 are working fine, but both oracle and postgresql fail trying to read table hibernate_sequence.

Here is a sample mapping for an id:

<id name="cslogicalDeviceId" type="java.lang.Long">
<column name="CSLogicalDeviceID" />
<generator class="native">
<param name="sequence">CSLOGICALDEVICE_ID_SEQ</param>
</generator>
</id>

I first tried to get around this by adding the following to my config file:
<property name="use_new_id_generator_mappings">false</property>

That did not work. I then tried to programmatically change the setting like this:

MetadataBuilder metadataBuilder = new MetadataSources(serviceRegistryCommon).getMetadataBuilder();
metadataBuilder.enableNewIdentifierGeneratorSupport(false);
factoryCommon = metadataBuilder.build().buildSessionFactory();

That also failed.

Any ideas on how I can get hibernate to use the named sequence?

Thanks


Top
 Profile  
 
 Post subject: Re: native generator in hibernate 5.2.7 ignores sequence name
PostPosted: Thu Feb 02, 2017 1:41 pm 
Newbie

Joined: Wed Aug 15, 2012 8:41 am
Posts: 3
I looked at the hibernate source and found a different property name.
This resolved the issue for me:

<property name="hibernate.id.new_generator_mappings">false</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.