The following issue has been updated:

    Updater: Chien-Hsing Wu (mailto:[EMAIL PROTECTED])
       Date: Sat, 25 Sep 2004 11:41 AM
    Comment:
xdoclet-1.2.1\modules\hibernate\src\xdoclet\modules\hibernate\HibernateTagsHandler.java
    Changes:
             Attachment changed to HibernateTagsHandler.java
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1079?page=history

---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1079

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XDT-1079
    Summary: Allow hibernate.component to specify a index prefix
       Type: Improvement

     Status: Open
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XDoclet
 Components: 
             Hibernate Module
   Versions:
             1.2.1

   Assignee: xdoclet-devel (Use for new issues)
   Reporter: Chien-Hsing Wu

    Created: Tue, 21 Sep 2004 5:52 PM
    Updated: Sat, 25 Sep 2004 11:41 AM

Description:
Related to XDT-733.

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>




---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to