- This topic has 3 replies, 2 voices, and was last updated 18 years, 2 months ago by Haris Peco.
-
AuthorPosts
-
UDCMemberWhen 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!
Haris PecoMemberUDC,
Please, can you sent example and version eclipse and MyEclipse
Thanks
UDCMemberSure.
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.
Haris PecoMemberUDC,
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 quickSorry for the inconvenience caused
Best
Peco -
AuthorPosts