[ http://jira.codehaus.org/browse/XDP-126?page=all ]

Diogo Bacelar Quintela updated XDP-126:
---------------------------------------

    Fix Version: 1.0.4

> Allow hibernate.component to specify a index prefix
> ---------------------------------------------------
>
>          Key: XDP-126
>          URL: http://jira.codehaus.org/browse/XDP-126
>      Project: XDoclet 2 Plugins
>         Type: Bug

>   Components: hibernate
>     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



-------------------------------------------------------
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
xdoclet-plugins-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest

Reply via email to