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


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:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
xdoclet-plugins-interest mailing list
xdoclet-plugins-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-plugins-interest

Reply via email to