Hello, first, thanks you for your interest
Seam verion is 2.0.1.GA
hibernate version: is 3.2.6
I'm developing with eclipse debuging with a jboss server version AS 4.2.2.GA
We are not using JEE @Entity beans, but simples POJOS as DTO's. This classes were automaticaly generated by hibernate revenger.
I think it may be important because all examples I've ever seen using custom validators posibly refers to use validating annotations over @Entity classes.
The following code is the complete bean (this is the bean class with a few anotations just for testing validation, no more).
package es.jccm.educa.app.contratacion.model.beans;
// Generated 25-sep-2008 10:33:24 by Hibernate Tools 3.2.1.GA
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Transient;
import org.hibernate.validator.AssertTrue;
import org.hibernate.validator.Email;
import org.hibernate.validator.NotEmpty;
import es.jccm.educa.comun.Nif;
import es.jccm.educa.comun.NifUtil;
import es.jccm.educa.comun.PasswordPolicyRestricted;
import es.jccm.educa.comun.UniqueSimpleKey;
/**
* Tercero generated by hbm2java
*/
public class Tercero implements java.io.Serializable {
private BigDecimal codTercero;
private int version;
private Localidads localidads;
private Paises paises;
private Expediente expediente;
private Provincias provincias;
@Nif
private String cifNif;
private String numAcreedorTarea;
private String tipo;
@NotEmpty
private String nombre;
private String apellidos;
private String ciudad;
private String domicilio;
private String cpostal;
private String personaContacto;
private String telefono1;
private String telefono2;
private String fax1;
private String fax2;
private String movil;
@AssertTrue(message="Msg el nif no es valido")
@Transient
public boolean isValidxyz() {
System.out.println(" llamando isValidxyz por el framework de validacion !!!!");
return false;
}
//@PasswordPolicyRestricted(minDigits=4)
//@Email
//@UniqueSimpleKey (tableName = "APPUSER", pkColumnName = "USER_NAME", message="This user already exists")
private String email;
private String web;
private String activo;
private String usuAlta;
private Date FAlta;
private String usuModificacion;
private Date FModificacion;
private String usuBaja;
private Date FBaja;
private Set terceroEntTramitas = new HashSet(0);
private Set terceroContactos = new HashSet(0);
private Set terceroUtesForCodTercero = new HashSet(0);
private Set licitadors = new HashSet(0);
private Set expedientes = new HashSet(0);
private Set terceroUtesForCodUte = new HashSet(0);
private Set terceroTipoTerceros = new HashSet(0);
public Tercero() {
}
public Tercero(BigDecimal codTercero, String tipo, String nombre,
String activo) {
this.codTercero = codTercero;
this.tipo = tipo;
this.nombre = nombre;
this.activo = activo;
}
public Tercero(BigDecimal codTercero, Localidads localidads, Paises paises,
Expediente expediente, Provincias provincias, String cifNif,
String numAcreedorTarea, String tipo, String nombre,
String apellidos, String ciudad, String domicilio, String cpostal,
String personaContacto, String telefono1, String telefono2,
String fax1, String fax2, String movil, String email, String web,
String activo, String usuAlta, Date FAlta, String usuModificacion,
Date FModificacion, String usuBaja, Date FBaja,
Set terceroEntTramitas, Set terceroContactos,
Set terceroUtesForCodTercero, Set licitadors, Set expedientes,
Set terceroUtesForCodUte, Set terceroTipoTerceros) {
this.codTercero = codTercero;
this.localidads = localidads;
this.paises = paises;
this.expediente = expediente;
this.provincias = provincias;
this.cifNif = cifNif;
this.numAcreedorTarea = numAcreedorTarea;
this.tipo = tipo;
this.nombre = nombre;
this.apellidos = apellidos;
this.ciudad = ciudad;
this.domicilio = domicilio;
this.cpostal = cpostal;
this.personaContacto = personaContacto;
this.telefono1 = telefono1;
this.telefono2 = telefono2;
this.fax1 = fax1;
this.fax2 = fax2;
this.movil = movil;
this.email = email;
this.web = web;
this.activo = activo;
this.usuAlta = usuAlta;
this.FAlta = FAlta;
this.usuModificacion = usuModificacion;
this.FModificacion = FModificacion;
this.usuBaja = usuBaja;
this.FBaja = FBaja;
this.terceroEntTramitas = terceroEntTramitas;
this.terceroContactos = terceroContactos;
this.terceroUtesForCodTercero = terceroUtesForCodTercero;
this.licitadors = licitadors;
this.expedientes = expedientes;
this.terceroUtesForCodUte = terceroUtesForCodUte;
this.terceroTipoTerceros = terceroTipoTerceros;
}
public BigDecimal getCodTercero() {
return this.codTercero;
}
public void setCodTercero(BigDecimal codTercero) {
this.codTercero = codTercero;
}
public int getVersion() {
return this.version;
}
public void setVersion(int version) {
this.version = version;
}
public Localidads getLocalidads() {
return this.localidads;
}
public void setLocalidads(Localidads localidads) {
this.localidads = localidads;
}
public Paises getPaises() {
return this.paises;
}
public void setPaises(Paises paises) {
this.paises = paises;
}
public Expediente getExpediente() {
return this.expediente;
}
public void setExpediente(Expediente expediente) {
this.expediente = expediente;
}
public Provincias getProvincias() {
return this.provincias;
}
public void setProvincias(Provincias provincias) {
this.provincias = provincias;
}
@AssertTrue(message="El nif no es valido")
public boolean validaCifNif(){
return NifUtil.validarNif(cifNif);
}
public String getCifNif() {
return this.cifNif;
}
public void setCifNif(String cifNif) {
System.out.println("llamado a setNifCif");
this.cifNif = cifNif;
}
public String getNumAcreedorTarea() {
return this.numAcreedorTarea;
}
public void setNumAcreedorTarea(String numAcreedorTarea) {
this.numAcreedorTarea = numAcreedorTarea;
}
public String getTipo() {
return this.tipo;
}
public void setTipo(String tipo) {
this.tipo = tipo;
}
public String getNombre() {
return this.nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getApellidos() {
return this.apellidos;
}
public void setApellidos(String apellidos) {
this.apellidos = apellidos;
}
public String getCiudad() {
return this.ciudad;
}
public void setCiudad(String ciudad) {
this.ciudad = ciudad;
}
public String getDomicilio() {
return this.domicilio;
}
public void setDomicilio(String domicilio) {
this.domicilio = domicilio;
}
public String getCpostal() {
return this.cpostal;
}
public void setCpostal(String cpostal) {
this.cpostal = cpostal;
}
public String getPersonaContacto() {
return this.personaContacto;
}
public void setPersonaContacto(String personaContacto) {
this.personaContacto = personaContacto;
}
public String getTelefono1() {
return this.telefono1;
}
public void setTelefono1(String telefono1) {
this.telefono1 = telefono1;
}
public String getTelefono2() {
return this.telefono2;
}
public void setTelefono2(String telefono2) {
this.telefono2 = telefono2;
}
public String getFax1() {
return this.fax1;
}
public void setFax1(String fax1) {
this.fax1 = fax1;
}
public String getFax2() {
return this.fax2;
}
public void setFax2(String fax2) {
this.fax2 = fax2;
}
public String getMovil() {
return this.movil;
}
public void setMovil(String movil) {
this.movil = movil;
}
public String getEmail() {
return this.email;
}
public void setEmail(String email) {
System.out.println("debug setEmail(");
this.email = email;
}
public String getWeb() {
return this.web;
}
public void setWeb(String web) {
this.web = web;
}
public String getActivo() {
return this.activo;
}
public void setActivo(String activo) {
this.activo = activo;
}
public String getUsuAlta() {
return this.usuAlta;
}
public void setUsuAlta(String usuAlta) {
this.usuAlta = usuAlta;
}
public Date getFAlta() {
return this.FAlta;
}
public void setFAlta(Date FAlta) {
this.FAlta = FAlta;
}
public String getUsuModificacion() {
return this.usuModificacion;
}
public void setUsuModificacion(String usuModificacion) {
this.usuModificacion = usuModificacion;
}
public Date getFModificacion() {
return this.FModificacion;
}
public void setFModificacion(Date FModificacion) {
this.FModificacion = FModificacion;
}
public String getUsuBaja() {
return this.usuBaja;
}
public void setUsuBaja(String usuBaja) {
this.usuBaja = usuBaja;
}
public Date getFBaja() {
return this.FBaja;
}
public void setFBaja(Date FBaja) {
this.FBaja = FBaja;
}
public Set getTerceroEntTramitas() {
return this.terceroEntTramitas;
}
public void setTerceroEntTramitas(Set terceroEntTramitas) {
this.terceroEntTramitas = terceroEntTramitas;
}
public Set getTerceroContactos() {
return this.terceroContactos;
}
public void setTerceroContactos(Set terceroContactos) {
this.terceroContactos = terceroContactos;
}
public Set getTerceroUtesForCodTercero() {
return this.terceroUtesForCodTercero;
}
public void setTerceroUtesForCodTercero(Set terceroUtesForCodTercero) {
this.terceroUtesForCodTercero = terceroUtesForCodTercero;
}
public Set getLicitadors() {
return this.licitadors;
}
public void setLicitadors(Set licitadors) {
this.licitadors = licitadors;
}
public Set getExpedientes() {
return this.expedientes;
}
public void setExpedientes(Set expedientes) {
this.expedientes = expedientes;
}
public Set getTerceroUtesForCodUte() {
return this.terceroUtesForCodUte;
}
public void setTerceroUtesForCodUte(Set terceroUtesForCodUte) {
this.terceroUtesForCodUte = terceroUtesForCodUte;
}
public Set getTerceroTipoTerceros() {
return this.terceroTipoTerceros;
}
public void setTerceroTipoTerceros(Set terceroTipoTerceros) {
this.terceroTipoTerceros = terceroTipoTerceros;
}
}