customise hibernate association name

James Neville <[email protected]>
Newsgroups gmane.comp.java.ejb.middlegen.user
Message-ID <[email protected]>
Hi all,

Is there a way to rename the hibernate mapping relation names using the 
middlegen-prefs.properties file?

I have an employee table with an FK of its employeeid - secretaryid.
I'd like to rename the many-to-one of employee to, say, 
employeeBySecretaryId or similar.
Employee as a child of Employee is far too confusing in the the business 
logic.;)

(see snippet below)

thanks,

James.


<snip>
<id
        name="employeeid"
        type="long"
        column="employeeid"
    >
        <meta attribute="field-description">
           @hibernate.id
            generator-class="sequence"
            type="long"
            column="employeeid"

           @hibernate.generator-param
            name="sequence"
            value="seq_employee_id"
        </meta>
        <generator class="sequence">
            <param name="sequence">seq_employee_id</param>
        </generator>
    </id>
<snip>


    <!-- bi-directional many-to-one association to Employee -->
    <many-to-one
        name="employee"
        class="com.babcockbrown.hibernate.vo.Employee"
        not-null="true"
    >
        <meta attribute="field-description">
           @hibernate.many-to-one
            not-null="true"
           @hibernate.column name="secretaryid"        
        </meta>
        <column name="secretaryid" />
    </many-to-one>
<snip>






-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.