Support Join tag with subtags including <key>, <property>, <many-to-one>,
<component>
-------------------------------------------------------------------------------------
Key: XDP-213
URL: http://jira.codehaus.org/browse/XDP-213
Project: XDoclet 2 Plugins
Issue Type: Improvement
Components: hibernate
Affects Versions: 1.0.3
Reporter: Ryan Ye
Attachments: join-patch.txt
This patch can be viewed as a further solution to issue
(http://jira.codehaus.org/browse/XDP-67).
I get the idea from girish sathe. I add a extra attribute "join-name" to
@hibernate.property, @hibernate.many-to-one, @hiberante.component tag, so you
can define @hibernate.join in class level, and its sub element in method and
field level. The following code is the test case I include in this patch.
package org.xdoclet.plugin.hibernate.pojo;
/**
* @author Ryan Ye
* @hibernate.class table="join_parent_table"
* @hibernate.join name="testJoin" table="join_table"
* @hibernate.join-key column="join_key_column"
*/
public class JoinMapping {
/**
* @hibernate.id generator-class="assigned"
*/
public Integer getId(){
return null;
}
/**
* @hibernate.property column="join_property_column"
join-name="testJoin"
*/
public String getJoinProperty(){
return null;
}
/**
* @hibernate.many-to-one column="join_foreign_key_column"
join-name="testJoin"
*/
public Simple getManyToOne() {
return null;
}
}
this java src file will generate,
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class table="join_parent_table"
name="org.xdoclet.plugin.hibernate.pojo.JoinMapping">
<id access="property" name="id">
<generator class="assigned"/>
</id>
<join table="join_table">
<key column="join_key_column"/>
<property name="joinProperty" access="property"
column="join_property_column"/>
<many-to-one column="join_foreign_key_column" access="property"
name="manyToOne"/>
</join>
</class>
</hibernate-mapping>
To make this patch work,
1. you should first download patch_new.txt at
http://jira.codehaus.org/browse/XDP-67.
2. Next goto http://jira.codehaus.org/browse/XDP-150, that patch is about
method="access" issure of hibernate3.0.
If you don't patch that one, JoinTestCase won't be passed. Or, you can manually
change access = "property" to access ="method" in JoinMapping.hbm.xml.
3. patch join_patch.txt
Gook Luck to all !
--
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
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
xdoclet-plugins-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest