[ http://jira.codehaus.org/browse/XDP-67?page=comments#action_53793 ]
girish sathe commented on XDP-67:
---------------------------------
is there any one looking for this issue ? i have another one issue also
Julian ,
i have tried following for generating join
my finding at this time are
in join.jelly , i found that , there is no logic fot grouping the tags which
can come under join
as per hibernate3.0 DTD we can have 6 tags common to class & join tags
eg. <property>,<any> ect can appear in class as well as join rt?
so i added one more property named "join-name" in all this 6 common tags
so you need to put it like following in ur class , if you want that element to
be generated inside <join>..... </join>
/**
* @hibernate.class table="ZTEST"
* @hibernate.join table="P_XTEST" join-name="testJoin"
* @hibernate.join-key column="ABC" join-name="testJoin"
*
* @hibernate.join table="P1_XTEST" join-name="testJoin1"
* @hibernate.join-key column="ABC1" join-name="testJoin1"
*
*/
public class Z implements X {
private Long id;
private P p;
private Integer i;
......
...
/**
* @hibernate.many-to-one
* column="P_ID"
* join-name="testJoin"
*/
public P getP() {
return p;
}
..
..
..
..
..
}
the changes were done in many files
but this will ensure that the tags which contain join-name="XXX" will get
generated in that join
here i have problem in scripting
i was able to generate this logic for key as shown above but could not able to
do same for other 5 tags common to class & join
from above the generated join mapping will look like following
<join table="P_XTEST">
<key column="ABC"/>
</join>
<join table="P1_XTEST">
<key column="ABC1"/>
</join>
here i have expected to get <many-to-one> also inside the join as in above
example i have added join-name="testjoin" to it ,
but it is not getting generated
> hibernate join table property cannot be configured
> --------------------------------------------------
>
> Key: XDP-67
> URL: http://jira.codehaus.org/browse/XDP-67
> Project: XDoclet 2 Plugins
> Type: Bug
> Components: hibernate
> Versions: hibernate-1.0
> Reporter: Andreas Wuest
> Attachments: screenshot-1.jpg
>
>
> Hello,
> i have a small problem with join tables in xdoclet 2. i have a class
> mapping that contains the following join table mapping (works fine
> with hibernate 3.0), unnecessary tags removed so it is better to read :
> <class name="Geschaeft" table="BA2_E_GESCHAEFT_VW" discriminator-value="-5"
> lazy="false">
> <composite-id name="id" class="GeschaeftPK">
> <key-property name="bank" type="java.lang.Long">
> <column name="BANK_ID" scale="3" precision="0" not-null="true"
> sql-type="NUMBER" />
> </key-property>
> <key-property name="stichtag" type="java.lang.Long">
> <column name="STICHTAG" scale="8" precision="0" not-null="true"
> sql-type="NUMBER" />
> </key-property>
> <key-property name="laufkennung" type="java.lang.Long">
> <column name="LAUFKENNUNG_NR" scale="2" precision="0" not-null="true"
> sql-type="NUMBER" />
> </key-property>
> <key-property name="kontoNr" type="java.lang.Long">
> <column name="KONTO_NR" scale="15" precision="0" not-null="true"
> sql-type="NUMBER" />
> </key-property>
> <key-property name="kontoNrSub" type="java.lang.Long">
> <column name="KONTO_NR_SUB" scale="15" precision="0" not-null="true"
> sql-type="NUMBER" />
> </key-property>
> </composite-id>
> <join table="BA2_R_GESCHAEFT_VW" optional="true" inverse="false"
> fetch="join">
> <key>
> <column name="BANK_ID" scale="3" precision="0" not-null="true"
> sql-type="NUMBER" />
> <column name="STICHTAG" scale="8" precision="0" not-null="true"
> sql-type="NUMBER" />
> <column name="LAUFKENNUNG_NR" scale="2" precision="0"
> not-null="true" sql-type="NUMBER" />
> <column name="KONTO_NR" scale="15" precision="0" not-null="true"
> sql-type="NUMBER" />
> <column name="KONTO_NR_SUB" scale="15" precision="0" not-null="true"
> sql-type="NUMBER" />
> </key>
> <property name="istKurzfristig" type="java.lang.Boolean">
> <column name="IST_KURZFRISTIG" scale="1" precision="0"
> not-null="false" sql-type="NUMBER" />
> </property>
> </join>
> </class>
> problem is, that
> i have no idea how to tell xdoclet 2 that the property "istKurzfristig"
> has to be within the join tag. xdoclet always adds the property
> tag to the class tag that surrounds the join tag. Looking at the
> Join.jelly file it looks like it is not possible to add properties
> to the join table tag, which makes the join tag impossible to use
> with xdoclet 2, or did i miss something ?
> another minor problem:
> incomplete documentation : @hibernate.join-key is not documented
> at http://xdoclet.codehaus.org/HibernateTags
> however it is required if you are using @hibernate.join (error message
> tell you that the join-key is missing
> [xdoclet] 15.06.2005 16:24:18
> org.apache.commons.jelly.expression.jexl.JexlExp
> ression evaluate
> [xdoclet] WARNUNG: Caught exception evaluating:
> org.apache.commons.jexl.Expres
> [EMAIL PROTECTED] Reason: java.lang.RuntimeException: hibernate.join-key is
> requi
> red in AbstractGeschaeft at line 90
> [xdoclet] java.lang.RuntimeException: hibernate.join-key is required in
> Abstra
> ctGeschaeft at line 90
> [xdoclet] at org.generama.Plugin.assertTrue(Plugin.java:158)
> [xdoclet] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [xdoclet] at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcces
> sorImpl.java:39)
> regards,
> Andreas
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
xdoclet-plugins-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest