Hi,
I have the same problem, but in my case is a little diferent. I didn't
use final in my attributes I use the annotation @NotNull.
There's
There's something that I can do? Or the unique solution is stop use
the @Data and use just @Getter and @Setter?
Follow my code.
package br.com.ligdiagnosticos.scl.model.exame;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import lombok.Data;
import br.com.ligdiagnosticos.scl.model.apoio.Convenio;
import br.com.ligdiagnosticos.scl.model.apoio.Medico;
import br.com.ligdiagnosticos.scl.model.apoio.Procedencia;
import br.com.ligdiagnosticos.scl.model.apoio.Usuario;
import br.com.ligdiagnosticos.scl.model.common.GenericEntity;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract @Data class Exame extends GenericEntity {
private static final long serialVersionUID = -7215894532261917873L;
@NotNull
@ManyToOne
private Amostra amostra;
@Temporal(TemporalType.DATE)
private Date dataLiberacao;
@ManyToOne
private Medico medico;
@ManyToOne
private Convenio convenio;
@ManyToOne
private Procedencia procedencia;
@ManyToOne
@NotNull
private Usuario responsavel;
@ManyToOne
@NotNull
private Usuario tecnicoLiberacao;
private String obs;
public abstract String getNomeExame();
}
Best regards,
Makoto Hashimoto
On Oct 19, 7:22 am, Jason Hamm <
jhamm.busin...@gmail.com> wrote:
> It works perfect now. Thanks. How come in the video on the website, they
> dont have to use non final variables? Anyway, I will definitely start using
> lombok.
>
> On Tue, Oct 18, 2011 at 7:18 PM, AndreBogus <
bogusan...@googlemail.com>wrote:
>
>
>
>
>
>
>
> > @Jacek: That is not an entity class. Entity classes must not have
> > final fields. As per the J2EE tutorial: "The class must not be
> > declared final. No methods or persistent instance variables must be
> > declared final."
>
> > Remove the "final" from your instance variables and it will work.
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups group forhttp://
projectlombok.org/