ravi wrote:
having done some tweaks to the .xdt i got my solution working but then also found an existing fix that i decided to stick to.
you can implement the fix at the the Xdoclet JIRA for this same issue
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-733there's an improvement to the solution suggested which you can easily implement yourself.
enjoy
ravi
Thanks for the fix, Ravi. I'm using Xdoclet 1.2.1, but I am not getting the behavior descrbed with 'prefix'. I examined the .xdt and java source and see that the fix as described in Jira has been implemented in this version.
I've boiled it down to a simple example of a Person entity with two Address components, one for 'home' and one for 'billing' to illustrate.
Adding a 'prefix' attribute to the @hibernate.component tag does not result in a prefixed column attribute for the component's properties.
Can anyone confirm that XDoclet 1.2.1 accurately implements the 'prefix' additon to @hibernate.component ?
Here are the relevant snippets of the xdoclet tags and resulting mapping:
Code:
public class Person {
private Address billingAddress;
private Address homeAddress;
/** hibernate.component prefix="billing_" */
public getBillingAddress() {
return billingAddress;
}
/** hibernate.component prefix="home_" */
public getHomeAddress() {
return homeAddress;
}
}
Code:
<component
name="billingAddress"
class="Address"
>
<property
name="address1"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="address1" <!-- Expecting billing_address -->
/>
<property
name="address2"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="address2"
/>
<property
name="city"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="city"
/>
...
[/img]