[ http://jira.codehaus.org/browse/XDP-126?page=all ]
Konstantin Pribluda closed XDP-126. ----------------------------------- Resolution: Fixed Component prefixes are implemented in current snapshot version. > Allow hibernate.component to specify a index prefix > --------------------------------------------------- > > Key: XDP-126 > URL: http://jira.codehaus.org/browse/XDP-126 > Project: XDoclet 2 Plugins > Issue Type: Bug > Components: hibernate > Affects Versions: 1.0.1 > Reporter: Yuval Carmel > Fix For: 1.0.4 > > > Let's say we have a component: > public class PersonKey { > private String id; > private String type > ... > /** > * @hibernate.property > * @hibernate.column > * name="ID" > * index="PERSON_INDEX" > * > * @return Returns the id. > */ > public String getId() { > return id; > } > .... > /** > * @hibernate.property > * @hibernate.column > * name="TYPE" > * index="PERSON_INDEX" > * > * @return Returns the type. > */ > public String getType() { > return type; > } > ... > } > If this component is used in more than one entity, the index name should be > different. > public class Insured { > ... > /** > * @hibernate.component > * prefix="INSURED_" > * index-prefix="IDX_INSURED_" > */ > public PersonKey getPersonKey() { > ... > } > public class Employee { > ... > /** > * @hibernate.component > * prefix="EMPLOYEE_" > * index-prefix="IDX_EMPLOYEE_" > */ > public PersonKey getPersonKey() { > ... > } > This should cause the columns generated for "presonKey" to be prefixed with > "INSURED_" and the index name prefixed with "IDX_INSURED_". > Like the following element for Insured.hbm.xml : > <component > name="resourceKey" > class="....PersonKey" > > > <property > name="id" > type="java.lang.String" > update="true" > insert="true" > access="property" > > > <column > name="INSURED_ID" > index="IDX_INSURED_PERSON_INDEX" > /> > </property> > <property > name="type" > type="java.lang.String" > update="true" > insert="true" > access="property" > > > <column > name="INSURED_TYPE" > index="IDX_INSURED_PERSON_INDEX" > /> > </property> > </component> -- 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 ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ xdoclet-plugins-interest mailing list xdoclet-plugins-interest@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest