facebook

In correct mapping file being generated

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #272322 Reply

    Harjit
    Member

    Hi there,

    I’m running the following version

    Version: 5.5.1 GA
    Build id: 20070521-5.5.1-GA

    when I use the hibernate perscepctive to generate my .hbm files I’m seeing a very weird behaviour. I’m choosing the native from the drop down list to generate the keys for the table but its using the ID and generating the file as follows. I don’t want to use the class to handle my keys….

    
    <hibernate-mapping>
        <class name="com.nasd.fms.framework.database.hibernate.mapping.pojo.NetCap" table="NET_CAP" schema="NMAOWNER">
            <composite-id name="id" class="com.nasd.fms.framework.database.hibernate.mapping.pojo.NetCapId">
                <key-property name="firmCrdNb" type="long">
                    <column name="FIRM_CRD_NB" precision="8" scale="0" />
                </key-property>
                <key-property name="flngSeqNb" type="long">
                    <column name="FLNG_SEQ_NB" precision="8" scale="0" />
                </key-property>
            </composite-id>
            <many-to-one name="aplctFirm" class="com.nasd.fms.framework.database.hibernate.mapping.pojo.AplctFirm" update="false" insert="false" fetch="select">
                <column name="FIRM_CRD_NB" precision="8" scale="0" not-null="true" />
                <column name="FLNG_SEQ_NB" precision="8" scale="0" not-null="true" />
            </many-to-one>
            <property name="minNetCap" type="long">
                <column name="MIN_NET_CAP" precision="10" scale="0" />
            </property>
            <property name="altStdCmptnFl" type="string">
                <column name="ALT_STD_CMPTN_FL" length="2" not-null="true" />
            </property>
            <property name="xpnsShrngArgntFl" type="string">
                <column name="XPNS_SHRNG_ARGNT_FL" length="1" not-null="true" />
            </property>
            <property name="xpnsShrngIdNb" type="long">
                <column name="XPNS_SHRNG_ID_NB" precision="11" scale="0" not-null="true" />
            </property>
            <set name="netCapDisgmtRsns" inverse="true">
                <key>
                    <column name="FIRM_CRD_NB" precision="8" scale="0" not-null="true" />
                    <column name="FLNG_SEQ_NB" precision="8" scale="0" not-null="true" />
                </key>
                <one-to-many class="com.nasd.fms.framework.database.hibernate.mapping.pojo.NetCapDisgmtRsn" />
            </set>
            <set name="futFundgSrcs" inverse="true">
                <key>
                    <column name="FIRM_CRD_NB" precision="8" scale="0" not-null="true" />
                    <column name="FLNG_SEQ_NB" precision="8" scale="0" not-null="true" />
                </key>
                <one-to-many class="com.nasd.fms.framework.database.hibernate.mapping.pojo.FutFundgSrc" />
            </set>
            <set name="fnnclPrjtns" inverse="true">
                <key>
                    <column name="FIRM_CRD_NB" precision="8" scale="0" not-null="true" />
                    <column name="FLNG_SEQ_NB" precision="8" scale="0" not-null="true" />
                </key>
                <one-to-many class="com.nasd.fms.framework.database.hibernate.mapping.pojo.FnnclPrjtn" />
            </set>
            <set name="cstmrPrctnPrvsns" inverse="true">
                <key>
                    <column name="FIRM_CRD_NB" precision="8" scale="0" not-null="true" />
                    <column name="FLNG_SEQ_NB" precision="8" scale="0" not-null="true" />
                </key>
                <one-to-many class="com.nasd.fms.framework.database.hibernate.mapping.pojo.CstmrPrctnPrvsn" />
            </set>
            <set name="aplctFundgSrcs" inverse="true">
                <key>
                    <column name="FIRM_CRD_NB" precision="8" scale="0" not-null="true" />
                    <column name="FLNG_SEQ_NB" precision="8" scale="0" not-null="true" />
                </key>
                <one-to-many class="com.nasd.fms.framework.database.hibernate.mapping.pojo.AplctFundgSrc" />
            </set>
        </class>
    </hibernate-mapping>
    
    

    If I use Middlegen I don’t see this issue at all I get the file as follows

    
    <hibernate-mapping>
    <!-- 
        Created by the Middlegen Hibernate plugin
    
        http://boss.bekk.no/boss/middlegen/
        http://hibernate.sourceforge.net/
    -->
    
    <class 
        name="com.nasd.fms.framework.database.hibernate.pojo.NetCap" 
        table="NET_CAP"
    >
    
        <composite-id>
            <key-property 
                name="firmCrdNb" 
                column="FIRM_CRD_NB" 
                type="java.lang.Integer"
                length="8"
            />
            <key-property 
                name="flngSeqNb" 
                column="FLNG_SEQ_NB" 
                type="java.lang.Integer"
                length="8"
            />
        </composite-id>  
    
    #272323 Reply

    Loyal Water
    Member

    I have asked someone from the dev team to take a look at this issue. He will get back to you shortly. Thank you for your patience.

    #272324 Reply

    Harjit
    Member

    that would be great…. I have a demo in couple of hours….

    #272335 Reply

    Harjit
    Member

    I tried all the other Generators but for some reasons its generating the xml file the same way for all the others too.

    #272387 Reply

    Brian Fernandes
    Moderator

    Unfortunately there is no way in which you can disable the generation of the ID class from the UI, changing the generator does not have any effect on the generation of this composite class.

    I’ll file this with the Hibernate team as a feature request.

    Sorry for the inconvenience caused, let us know if you require further assistance.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: In correct mapping file being generated

You must be logged in to post in the forum log in