-->
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.  [ 3 posts ] 
Author Message
 Post subject: Identifier generator parameters are igored by hibernate 5.1
PostPosted: Mon Apr 18, 2016 10:44 pm 
Newbie

Joined: Mon Apr 18, 2016 10:31 pm
Posts: 3
Hi,

We are migrating hibernate from 4.3.11 to 5.1.0 in our product. We identified one behavior change after pulling the new hibernate jar. After debugging the code, we found hibernate is ignoring the parameters inside generator when the generator is used inside collection-id of idbag. Is this a bug in 5.1 or is this an intentional change? I can't find any reference to this change after googling.

Below is an example mapping file. The first generator used under id is fine. Hibernate passes in all parameters configured when calling KeyGeneratorBasedIdentifierGenerator. The second generator used in collection-id of idbag doesn't work. None of the parameters are passed to KeyGeneratorBasedIdentifierGenerator.


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="domain.scalestructure">
    <class name="ScaleStructureBean" table="SCALE_STRUCTURE">
        <id name="id" column="ID">
            <generator class="data.hibernate.KeyGeneratorBasedIdentifierGenerator">
                <param name="domain">RO</param>
                <param name="name">BUSINESS_OBJECT_ID</param>
                <param name="type">long</param>
            </generator>
        </id>
        <property name="scaleCurrencyCode" type="string" column="NEW_SCALE_CURRENCY_CODE" />
        <property name="scaleUomCode" type="string" column="NEW_SCALE_UOM_CODE" />
        <idbag name="ScaleTiers" table="SCALE_TIER" order-by="THRESHOLD" batch-size="200">
          <collection-id  type="long" column="ID">
            <generator class="data.hibernate.KeyGeneratorBasedIdentifierGenerator">
                <param name="domain">RO</param>
                <param name="name">BUSINESS_OBJECT_ID</param>
                <param name="type">long</param>
            </generator>
          </collection-id>
          <key column="SCALE_STRUCTURE_ID"/>
          <composite-element class="domain.scalestructure.ScaleTierBean">
            <property name="changeFlag" type="ChangeFlag" column="CHANGE_FLAG"/>
          </composite-element>
         </idbag>
    </class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: Identifier generator parameters are igored by hibernate 5.1
PostPosted: Tue Apr 19, 2016 12:24 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1630
Location: Romania
I think it is the HHH-10373 issue that you have bumped into. Andrea is working on it, and a fix will be provided in a future release.


Top
 Profile  
 
 Post subject: Re: Identifier generator parameters are igored by hibernate 5.1
PostPosted: Tue Apr 19, 2016 1:20 pm 
Newbie

Joined: Mon Apr 18, 2016 10:31 pm
Posts: 3
Thanks. We have a workaround now. We will wait for the next release to get the real fix.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.