-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: unique constraints in xdoclet2
PostPosted: Thu Jan 12, 2006 2:30 pm 
Newbie

Joined: Thu Jan 12, 2006 2:19 pm
Posts: 3
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!


Top
 Profile  
 
 Post subject: sorry, wrong forum
PostPosted: Thu Jan 12, 2006 2:39 pm 
Newbie

Joined: Thu Jan 12, 2006 2:19 pm
Posts: 3
I'm really sorry, I should have posted this in the tools forum


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.