Hi, I'm trying to generate the mappings using xdoclet2. I need a multi-column unique constraint, and i added an @hibernate.properties tag.
The hbm.xml file is generated, but neither the <properties> nor the fields within it are present. This is my code, and at the bottom i've copied the generated file:
/**
* @hibernate.class
* table="SCOPE"
* Clase del modelo de negocio que representa a un Alcance.
* @author marce
*
*/
public class Scope implements ModelEntity {
/**
* @hibernate.properties * name="const" * unique="true"
*/
/**
*
*/
private Integer id;
/**
*
*/
private String name = "";
/**
*
*/
private String code = "";
/**
*
*/
private Scope parent = null;
/**
*
*/
private Site site = null;
/**
* Constructor default.
*
*/
public Scope(){
}
/**
*
* @param site sitio al que pertenece
* @param code codigo del alcance
* @param name nombre del alcance
* @param parentScope alcance padre si tiene
*/
public Scope(Site site, String code, String name, Scope parentScope) {
this.site = site;
this.parent = parentScope;
this.code = code;
this.name = name;
}
/**
*
* @param id
* @param site
* @param code
* @param name
* @param parentScope
*/
public Scope(Integer id, Site site, String code, String name, Scope parentScope) {
this.id = id;
this.site = site;
this.parent = parentScope;
this.code = code;
this.name = name;
}
/**
* Getter del atributo code.
* @return Retorna el code.
* @hibernate.property
* length="10"
* not-null="true"
* properties-name="const"
*
*/
public String getCode() {
return code;
}
/**
* Setter del atributo code.
* @param code El code a setear.
*/
public void setCode(String code) {
this.code = code;
}
/**
* Getter del atributo id.
* @return Retorna el id.
*
* @hibernate.id
* column="ID"
* generator-class="native"
*/
public Integer getId() {
return id;
}
/**
* Setter del atributo id.
* @param id El id a setear.
*/
public void setId(Integer id) {
this.id = id;
}
/**
* Getter del atributo name.
* @return Retorna el name.
*
* @hibernate.property
* length="80"
* not-null="true"
*/
public String getName() {
return name;
}
/**
* Setter del atributo name.
* @param name El name a setear.
*/
public void setName(String name) {
this.name = name;
}
/**
* Getter del atributo parent.
* @return Retorna el parent.
*
* @hibernate.many-to-one
* properties-name="const"
*/
public Scope getParent() {
return parent;
}
/**
* Setter del atributo parent.
* @param parent El parent a setear.
*/
public void setParent(Scope parent) {
this.parent = parent;
}
/**
* Getter del atributo site.
* @return Retorna el site.
*
* @hibernate.many-to-one
* not-null="true"
*/
public Site getSite() {
return site;
}
/**
* Setter del atributo site.
* @param site El site a setear.
*/
public void setSite(Site site) {
this.site = site;
}
}
Generated file
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class table="SCOPE" name="com.sisdam.david.business.model.Scope">
<id column="ID" access="method" name="id">
<generator class="native"/>
</id>
<property name="name" not-null="true" length="80" access="method"/>
<many-to-one not-null="true" access="method" name="site"/>
</class>
</hibernate-mapping>
Does anyone have any idea of what's wrong?
Thanks!
|