hibernate 2.1:
middlegen 2.0:
Hello,
my pbs are:
I use middlegen to generate hbm files from a database MSSQL Server 5.0.
1) when i launch the gui, no table/ relation appears and the gui is empty, but i can generate the hbm files, something to do in a setting file?
2) some tables relations in DB are like that:
table HIS_T_Act has a composite id (ActRefDos and ActId)
table HIS_T_Actcmt has a composite id (ActcmtRefDos, ActcmtRefAct) which is a foreign key from HIS_T_Act
this is a one-to-one relation, for each HIS_T_Act there is one HIS_T_Actcmt
middlegen genrates HIS_T_Actcmt.hbm.xml :
...
<class
name="org.virbac.rai.data.beans.HisTActcmt"
table="HIS_T_Actcmt"
>
<composite-id>
<!-- bi-directional one-to-one association to HisTAct -->
<key-many-to-one
name="hisTAct"
class="org.virbac.rai.data.beans.HisTAct"
>
<column name="ActcmtRefDos" />
<column name="ActcmtRefAct" />
</key-many-to-one>
</composite-id>
<property
name="actcmtTxt"
type="java.lang.String"
column="ActcmtTxt"
length="2147483647"
/>
<!-- associations -->
<!-- bi-directional one-to-one association to HisTAct -->
<one-to-one
name="hisTAct"
class="org.virbac.rai.data.beans.HisTAct"
outer-join="auto"
constrained="true"
/>
</class>
...
as you can see, there is two element whose name is "hisTAct", the <key-many-to-one> in compisite id, and the <one-to-one> link to HIS_T_Act table
so when i launch hbm2java after, i get His_T_ActCmt.java:
...
/** @author Hibernate CodeGenerator */
public class HisTActcmt implements Serializable {
/** nullable persistent field */
private String actcmtTxt;
/** nullable persistent field */
private org.virbac.rai.data.beans.HisTAct hisTAct;
/** identifier field */
private org.virbac.rai.data.beans.HisTAct hisTAct;
/** full constructor */
public HisTActcmt(String actcmtTxt, org.virbac.rai.data.beans.HisTAct hisTAct, org.virbac.rai.data.beans.HisTAct hisTAct) {
this.actcmtTxt = actcmtTxt;
this.hisTAct = hisTAct;
this.hisTAct = hisTAct;
}
/** default constructor */
public HisTActcmt() {
}
...
as you can see, there are two elements named hisTAct.
So what to do?
Please help!
Geordy
|