2 Replies Latest reply on Dec 14, 2009 7:58 AM by neni ferawati

    not-null property references a null or transient

    neni ferawati Newbie
      Hi, guys!!
      I have error code in alumni entity:
      Caused by javax.servlet.ServletException with message: "#{alumniHome.update}: javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.alumni.model.Alumni.status"

      and this alumni entity code :
      package org.alumni.model;
      // Generated Dec 7, 2009 5:18:27 PM by Hibernate Tools 3.2.2.GA

      import java.util.Date;
      import javax.persistence.Column;
      import javax.persistence.Entity;
      import javax.persistence.GeneratedValue;
      import static javax.persistence.GenerationType.IDENTITY;

      import javax.persistence.FetchType;
      import javax.persistence.Id;
      import javax.persistence.JoinColumn;
      import javax.persistence.ManyToOne;
      import javax.persistence.Table;
      import javax.persistence.Temporal;
      import javax.persistence.TemporalType;

      import org.hibernate.validator.Length;
      import org.hibernate.validator.NotNull;

      /**
      * Alumni generated by hbm2java
      */
      @Entity
      @Table(name = "alumni")
      public class Alumni implements java.io.Serializable {

           private Long idAlumni;
           private String namaLengkap;
           private String nim;
           private String prodi;
           private String jenisKelamin;
           private String status;
           private String tempatLahir;
           private Date tanggalLahir;
           private String alamatKontak;
           private String kelurahan;
           private String kecamatan;
           private String kabupaten;
           private String propinsi;
           private String kodePos;
           private String noTelp;
           private String noHp;
           private String email;
           private String alamatKantor;
           private String noTelpKantor;
           private String asalSmu;
           private String kabupatenSmu;
           private String propinsiSmu;

           
           private Pendidikan pendidikan;
           private Pekerjaan pekerjaan;
           private Pengalaman pengalaman;
           private Relevansi relevansi;
           private Indikator indikator;
           
           
           
           public Alumni() {
           }

           public Alumni(String namaLengkap, String nim, String prodi,
                     String jenisKelamin, String status, String tempatLahir,
                     Date tanggalLahir, String alamatKontak, String kelurahan,
                     String kecamatan, String kabupaten, String propinsi,
                     String kodePos, String noTelp, String noHp, String email,
                     String alamatKantor, String noTelpKantor, String asalSmu,
                     String kabupatenSmu, String propinsiSmu,
                     Pendidikan pendidikan, Pekerjaan pekerjaan, Pengalaman pengalaman,
                     Relevansi relevansi, Indikator indikator) {
                this.namaLengkap = namaLengkap;
                this.nim = nim;
                this.prodi = prodi;
                this.jenisKelamin = jenisKelamin;
                this.status = status;
                this.tempatLahir = tempatLahir;
                this.tanggalLahir = tanggalLahir;
                this.alamatKontak = alamatKontak;
                this.kelurahan = kelurahan;
                this.kecamatan = kecamatan;
                this.kabupaten = kabupaten;
                this.propinsi = propinsi;
                this.kodePos = kodePos;
                this.noTelp = noTelp;
                this.noHp = noHp;
                this.email = email;
                this.alamatKantor = alamatKantor;
                this.noTelpKantor = noTelpKantor;
                this.asalSmu = asalSmu;
                this.kabupatenSmu = kabupatenSmu;
                this.propinsiSmu = propinsiSmu;
                this.pendidikan = pendidikan;
                this.pekerjaan = pekerjaan;
                this.pengalaman = pengalaman;
                this.relevansi = relevansi;
                this.indikator = indikator;
           }

           @Id
           @GeneratedValue(strategy = IDENTITY)
           @Column(name = "ID_ALUMNI", unique = true, nullable = false)
           public Long getIdAlumni() {
                return this.idAlumni;
           }

           public void setIdAlumni(Long idAlumni) {
                this.idAlumni = idAlumni;
           }

           @Column(name = "NAMA_LENGKAP", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getNamaLengkap() {
                return this.namaLengkap;
           }

           public void setNamaLengkap(String namaLengkap) {
                this.namaLengkap = namaLengkap;
           }

           @Column(name = "NIM", nullable = false, length = 30)
           @NotNull
           @Length(max = 30)
           public String getNim() {
                return this.nim;
           }

           public void setNim(String nim) {
                this.nim = nim;
           }

           @Column(name = "PRODI", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getProdi() {
                return this.prodi;
           }

           public void setProdi(String prodi) {
                this.prodi = prodi;
           }

           @Column(name = "JENIS_KELAMIN", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getJenisKelamin() {
                return this.jenisKelamin;
           }

           public void setJenisKelamin(String jenisKelamin) {
                this.jenisKelamin = jenisKelamin;
           }

           @Column(name = "STATUS", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getStatus() {
                return this.status;
           }

           public void setStatus(String status) {
                this.status = status;
           }

           @Column(name = "TEMPAT_LAHIR", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getTempatLahir() {
                return this.tempatLahir;
           }

           public void setTempatLahir(String tempatLahir) {
                this.tempatLahir = tempatLahir;
           }
           @Temporal(TemporalType.DATE)
           @Column(name = "TANGGAL_LAHIR", nullable = false, length = 0)
           @NotNull
           public Date getTanggalLahir() {
                return this.tanggalLahir;
           }

           public void setTanggalLahir(Date tanggalLahir) {
                this.tanggalLahir = tanggalLahir;
           }

           @Column(name = "ALAMAT_KONTAK", nullable = false, length = 100)
           @NotNull
           @Length(max = 100)
           public String getAlamatKontak() {
                return this.alamatKontak;
           }

           public void setAlamatKontak(String alamatKontak) {
                this.alamatKontak = alamatKontak;
           }

           @Column(name = "KELURAHAN", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getKelurahan() {
                return this.kelurahan;
           }

           public void setKelurahan(String kelurahan) {
                this.kelurahan = kelurahan;
           }

           @Column(name = "KECAMATAN", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getKecamatan() {
                return this.kecamatan;
           }

           public void setKecamatan(String kecamatan) {
                this.kecamatan = kecamatan;
           }

           @Column(name = "KABUPATEN", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getKabupaten() {
                return this.kabupaten;
           }

           public void setKabupaten(String kabupaten) {
                this.kabupaten = kabupaten;
           }

           @Column(name = "PROPINSI", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getPropinsi() {
                return this.propinsi;
           }

           public void setPropinsi(String propinsi) {
                this.propinsi = propinsi;
           }

           @Column(name = "KODE_POS", nullable = false, length = 20)
           @NotNull
           @Length(max = 20)
           public String getKodePos() {
                return this.kodePos;
           }

           public void setKodePos(String kodePos) {
                this.kodePos = kodePos;
           }

           @Column(name = "NO_TELP", nullable = false, length = 30)
           @NotNull
           @Length(max = 30)
           public String getNoTelp() {
                return this.noTelp;
           }

           public void setNoTelp(String noTelp) {
                this.noTelp = noTelp;
           }

           @Column(name = "NO_HP", nullable = false, length = 30)
           @NotNull
           @Length(max = 30)
           public String getNoHp() {
                return this.noHp;
           }

           public void setNoHp(String noHp) {
                this.noHp = noHp;
           }

           @Column(name = "EMAIL", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getEmail() {
                return this.email;
           }

           public void setEmail(String email) {
                this.email = email;
           }

           @Column(name = "ALAMAT_KANTOR", nullable = false, length = 100)
           @NotNull
           @Length(max = 100)
           public String getAlamatKantor() {
                return this.alamatKantor;
           }

           public void setAlamatKantor(String alamatKantor) {
                this.alamatKantor = alamatKantor;
           }

           @Column(name = "NO_TELP_KANTOR", nullable = false, length = 30)
           @NotNull
           @Length(max = 30)
           public String getNoTelpKantor() {
                return this.noTelpKantor;
           }

           public void setNoTelpKantor(String noTelpKantor) {
                this.noTelpKantor = noTelpKantor;
           }

           @Column(name = "ASAL_SMU", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getAsalSmu() {
                return this.asalSmu;
           }

           public void setAsalSmu(String asalSmu) {
                this.asalSmu = asalSmu;
           }

           @Column(name = "KABUPATEN_SMU", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getKabupatenSmu() {
                return this.kabupatenSmu;
           }

           public void setKabupatenSmu(String kabupatenSmu) {
                this.kabupatenSmu = kabupatenSmu;
           }

           @Column(name = "PROPINSI_SMU", nullable = false, length = 50)
           @NotNull
           @Length(max = 50)
           public String getPropinsiSmu() {
                return this.propinsiSmu;
           }

           public void setPropinsiSmu(String propinsiSmu) {
                this.propinsiSmu = propinsiSmu;
           }

           
           
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "ID_PENDIDIKAN", referencedColumnName = "ID_PENDIDIKAN", nullable = false)
           @NotNull
           public Pendidikan getpendidikan() {
                return pendidikan;
           }
           
           public void setPendidikan (Pendidikan pendidikan){
                this.pendidikan = pendidikan;
           }
           
           
           
           
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "ID_PEKERJAAN", referencedColumnName = "ID_PEKERJAAN", nullable = false)
           @NotNull
           public Pekerjaan getPekerjaan() {
                return pekerjaan;
           }
           
           public void setPekerjaan(Pekerjaan pekerjaan){
                this.pekerjaan = pekerjaan;
           }
           
           
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "ID_PENGALAMAN", referencedColumnName = "ID_PENGALAMAN", nullable = false)
           @NotNull
           public Pengalaman getPengalaman() {
                return pengalaman;
           }
           
           public void setPengalaman(Pengalaman pengalaman){
                this.pengalaman = pengalaman;
           }
           
           
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "ID_RELEVANSI", referencedColumnName = "ID_RELEVANSI", nullable = false)
           @NotNull
           public Relevansi getRelevansi() {
                return relevansi;
           }
           
           public void setRelevansi(Relevansi relevansi){
                this.relevansi = relevansi;
           }
           
           
           @ManyToOne(fetch = FetchType.LAZY)
           @JoinColumn(name = "ID_INDIKATOR", referencedColumnName = "ID_INDIKATOR", nullable = false)
           @NotNull
           public Indikator getIndikator() {
                return indikator;
           }
           
           public void setIndikator(Indikator indikator){
                this.indikator = indikator;
           }
           
           
           
           
           
           
           
      }

      Thee "status" variable was set nullable=false and set not null in database
      what was I have to do?
      please help me.....