Hi!

I have a class with some properties that must be setted as unique (both). To accomplish this, I want to use the Hibernate <properties> tag. The problem is that I don't know how to configure it using xDoclet 2. I've found the following code, but it doesn't work me... Can anyone help me??

Thanks in advance.

Expedito.

/**
* @hibernate.class table="TableName" schema="schemaName"
 * @hibernate.properties name="unique_name" unique="true"
 */
public class ClassName
{
    private Integer id;

    private String prop1;

    private String prop2;;

    /**
     * @hibernate.property column="column1" not-null="true"      properties-name="unique_name"
     */
    public String getProp1()
    {
        return this.prop1;
    }

    /**
     * @hibernate.property column="column2" not-null="true"      properties-name="unique_name"
     */
    public String getProp2()
    {
        return this.prop2;
    }

    /**
     * @hibernate.id column="id" generator-class = "assigned"
     */
    public Integer getId()
    {
        return this.id;
    }

    // ... setters...
}


Yahoo! Messenger com voz - Instale agora e faça ligações de graça.

Reply via email to