facebook

Possible bug: Property names on relationships?

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

    UDC
    Member

    When I go through the hibernate generation wizard, I set a property for a parent table. This appears to be set right in the reveng.xml, but when the mapping file and pojo’s are generated, it uses the original field name, not the new name I have specified.

    Specifying a new name works on normal columns, that are not related to other tables.

    Does this sound like a bug? Or am I missing something in the setup?

    Thanks!

    #256426 Reply

    Haris Peco
    Member

    UDC,

    Please, can you sent example and version eclipse and MyEclipse

    Thanks

    #256439 Reply

    UDC
    Member

    Sure.

    In my reveng file, an example table is –

    <table name="hc_ordr_freq" schema="dba" catalog="mtrk"
            class="otrack.med.hibernate.OrderFrequency">
            <primary-key>
                <generator class="native" />
                <column name="seq" property="id" />
            </primary-key>
            <column name="hc_ordr_id" property="order" />
            <column name="hc_tm_prd_cd" property="timePeriodCode" />
            <column name="actn_exp_dt" property="actionExcpectedDate" />
            <column name="actn_pref_dt" property="actionPerformedDate" />
            <column name="actn_pref_tm" property="actionPerformedTime" />
            <column name="updt_usr_id" property="updatedByUserID" />
            <column name="updt_dt" property="updatedDate" />
    </table>

    In the reverse engineering wizard, it shows the hc_ordr_id column having the specified name order.

    In the generated pojo, it has –

    
    /**
     * AbstractOrderFrequency generated by MyEclipse - Hibernate Tools
     */
    
    public abstract class AbstractOrderFrequency  implements java.io.Serializable {
    
    
        // Fields    
    
         private Integer id;
         private Order hcOrdr;

    In the pojo, it should have order, from my understanding. At least, I want it to have order, not hcOrdr.

    In the .hbm that is generated, I have –

    <hibernate-mapping>
        <class name="otrack.med.hibernate.OrderFrequency" table="hc_ordr_freq">
            <id name="id" type="java.lang.Integer">
                <column name="seq" />
                <generator class="native"></generator>
            </id>
            <many-to-one name="hcOrdr" class="otrack.med.hibernate.Order" fetch="select">
                <column name="hc_ordr_id" />
            </many-to-one>

    The many-to-one name should be order. Any ideas on how to get this to work?

    MyEclipse 5.0GA

    Thanks.

    #256449 Reply

    Haris Peco
    Member

    UDC,
    I can reproduce your case and you are correct.You can’t change name for relations with reveng.xml, for now.
    We will try fix it quick

    Sorry for the inconvenience caused

    Best
    Peco

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Possible bug: Property names on relationships?

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