Hello there,
This is my POJO class :
[code]
@Entity(access = AccessType.PROPERTY)
@Table(name="Email")
public class Email implements Serializable
{
private int ID_EMAIL;
private String DESCRIPTION;
private Pessoa2 pessoa;
public Email()
{
}
public void setID_EMAIL(int ID_EMAIL)
{
this.ID_EMAIL = ID_EMAIL;
}
@Id
public int getID_EMAIL()
{
return ID_EMAIL;
}
/**
* @param descricao The descricao to set.
*/
public void setDESCRIPTION(String DESCRIPTION) throws IllegalArgumentException
{
if (DESCRIPTION.equals(""))
{
throw new IllegalArgumentException();
}
else
{
this.DESCRIPTION = DESCRIPTION;
}
}
/**
* @return Returns the descricao.
*/
@Column(name = "DESCRICAO", nullable = false, length=40)
public String getDESCRICAO()
{
return DESCRICAO;
}
/**
* @param tipo The Id_Pessoa to set.
*/
public void setPessoa(Pessoa2 pessoa)
{
this.pessoa = pessoa;
}
@ManyToOne( fetch=FetchType.EAGER)
@JoinColumn(name="Id_Pessoa")
public Pessoa2 getPessoa()
{
return pessoa;
}
}
[/code]
The method SetDESCRIPTION throws an Exception !!
There is a problem ??
thanks
|