Not Null property refers to a null or transient value
thiruneela Jan 20, 2009 2:58 PM-----------------------------------------------------------------
When I am trying to insert some values through the ui, it shows the following exceptions, "Not Null property refers to a null or transient value", I am including exceptions and My java bean class, Please suggest me some solutions.
Thanks in advance.
-----------------------------------------------------------------
Exception are
FATAL [application] /TasksEdit.xhtml @196,69 action="#{tasksHome.persist}": javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.domain.Portal.entity.Tasks.description1
javax.faces.el.EvaluationException: /TasksEdit.xhtml @196,69 action="#{tasksHome.persist}": javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.domain.Portal.entity.Tasks.description1
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
---------------------------------
Java bean is as follows
--------------------------
@Entity
@Table(name = "TASKS", schema = "dbo", catalog = "PORTALNEW")
public class Tasks implements java.io.Serializable {
private int id;
private TaskStatus taskStatus;
private Projects projects;
private Tasks tasks;
private TaskType taskType;
private String taskId;
private String taskTopic;
private String description1;
private double effort;
private Date estimatedStartDate;
private Date estimatedEndDate;
private Date actualStartDate;
private Date actualEndDate;
private String createdBy;
private Date createdDate;
private String modifiedBy;
private Date modifiedDate;
private Set<Tasks> taskses = new HashSet<Tasks>(0);
private Set<TaskAllocation> taskAllocations = new HashSet<TaskAllocation>(0);
private Set<WorkLog> workLogs = new HashSet<WorkLog>(0);
private Set<Timesheets> timesheetses = new HashSet<Timesheets>(0);
private Set<Tasks> taskses_1 = new HashSet<Tasks>(0);
private Set<Timesheets> timesheetses_1 = new HashSet<Timesheets>(0);
private Set<TaskAllocation> taskAllocations_1 = new HashSet<TaskAllocation>(
0);
private Set<WorkLog> workLogs_1 = new HashSet<WorkLog>(0);
private Set<TaskAllocation> taskAllocations_2 = new HashSet<TaskAllocation>(
0);
public Tasks() {
}
public Tasks(int id, TaskStatus taskStatus, String taskId,
String taskTopic, String description1, double effort,
String createdBy, Date createdDate, String modifiedBy,
Date modifiedDate) {
this.id = id;
this.taskStatus = taskStatus;
this.taskId = taskId;
this.taskTopic = taskTopic;
this.description1 = description1;
this.effort = effort;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.modifiedBy = modifiedBy;
this.modifiedDate = modifiedDate;
}
public Tasks(int id, TaskStatus taskStatus, Projects projects, Tasks tasks,
TaskType taskType, String taskId, String taskTopic,
String description1, double effort, Date estimatedStartDate,
Date estimatedEndDate, Date actualStartDate, Date actualEndDate,
String createdBy, Date createdDate, String modifiedBy,
Date modifiedDate, Set<Tasks> taskses,
Set<TaskAllocation> taskAllocations, Set<WorkLog> workLogs,
Set<Timesheets> timesheetses, Set<Tasks> taskses_1,
Set<Timesheets> timesheetses_1,
Set<TaskAllocation> taskAllocations_1, Set<WorkLog> workLogs_1,
Set<TaskAllocation> taskAllocations_2) {
this.id = id;
this.taskStatus = taskStatus;
this.projects = projects;
this.tasks = tasks;
this.taskType = taskType;
this.taskId = taskId;
this.taskTopic = taskTopic;
this.description1 = description1;
this.effort = effort;
this.estimatedStartDate = estimatedStartDate;
this.estimatedEndDate = estimatedEndDate;
this.actualStartDate = actualStartDate;
this.actualEndDate = actualEndDate;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.modifiedBy = modifiedBy;
this.modifiedDate = modifiedDate;
this.taskses = taskses;
this.taskAllocations = taskAllocations;
this.workLogs = workLogs;
this.timesheetses = timesheetses;
this.taskses_1 = taskses_1;
this.timesheetses_1 = timesheetses_1;
this.taskAllocations_1 = taskAllocations_1;
this.workLogs_1 = workLogs_1;
this.taskAllocations_2 = taskAllocations_2;
}
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "ID", unique = true, nullable = false)
@NotNull
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "STATUS", nullable = false)
@NotNull
public TaskStatus getTaskStatus() {
return this.taskStatus;
}
public void setTaskStatus(TaskStatus taskStatus) {
this.taskStatus = taskStatus;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PROJECT_ID")
public Projects getProjects() {
return this.projects;
}
public void setProjects(Projects projects) {
this.projects = projects;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public Tasks getTasks() {
return this.tasks;
}
public void setTasks(Tasks tasks) {
this.tasks = tasks;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TYPE")
public TaskType getTaskType() {
return this.taskType;
}
public void setTaskType(TaskType taskType) {
this.taskType = taskType;
}
@Column(name = "TASK_ID", nullable = false, length = 10)
@NotNull
@Length(max = 10)
public String getTaskId() {
return this.taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
@Column(name = "TASK_TOPIC", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getTaskTopic() {
return this.taskTopic;
}
public void setTaskTopic(String taskTopic) {
this.taskTopic = taskTopic;
}
@Column(name = "DESCRIPTION1", nullable = false, length = 1024)
@NotNull
@Length(max = 1024)
public String getDescription1() {
return this.description1;
}
public void setDescription1(String description1) {
this.description1 = description1;
}
@Column(name = "EFFORT", nullable = false, precision = 53, scale = 0)
@NotNull
public double getEffort() {
return this.effort;
}
public void setEffort(double effort) {
this.effort = effort;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ESTIMATED_START_DATE", length = 23)
public Date getEstimatedStartDate() {
return this.estimatedStartDate;
}
public void setEstimatedStartDate(Date estimatedStartDate) {
this.estimatedStartDate = estimatedStartDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ESTIMATED_END_DATE", length = 23)
public Date getEstimatedEndDate() {
return this.estimatedEndDate;
}
public void setEstimatedEndDate(Date estimatedEndDate) {
this.estimatedEndDate = estimatedEndDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ACTUAL_START_DATE", length = 23)
public Date getActualStartDate() {
return this.actualStartDate;
}
public void setActualStartDate(Date actualStartDate) {
this.actualStartDate = actualStartDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ACTUAL_END_DATE", length = 23)
public Date getActualEndDate() {
return this.actualEndDate;
}
public void setActualEndDate(Date actualEndDate) {
this.actualEndDate = actualEndDate;
}
@Column(name = "CREATED_BY", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getCreatedBy() {
return this.createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATED_DATE", nullable = false, length = 23)
@NotNull
public Date getCreatedDate() {
return this.createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Column(name = "MODIFIED_BY", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getModifiedBy() {
return this.modifiedBy;
}
public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "MODIFIED_DATE", nullable = false, length = 23)
@NotNull
public Date getModifiedDate() {
return this.modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Tasks> getTaskses() {
return this.taskses;
}
public void setTaskses(Set<Tasks> taskses) {
this.taskses = taskses;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<TaskAllocation> getTaskAllocations() {
return this.taskAllocations;
}
public void setTaskAllocations(Set<TaskAllocation> taskAllocations) {
this.taskAllocations = taskAllocations;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<WorkLog> getWorkLogs() {
return this.workLogs;
}
public void setWorkLogs(Set<WorkLog> workLogs) {
this.workLogs = workLogs;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Timesheets> getTimesheetses() {
return this.timesheetses;
}
public void setTimesheetses(Set<Timesheets> timesheetses) {
this.timesheetses = timesheetses;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Tasks> getTaskses_1() {
return this.taskses_1;
}
public void setTaskses_1(Set<Tasks> taskses_1) {
this.taskses_1 = taskses_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Timesheets> getTimesheetses_1() {
return this.timesheetses_1;
}
public void setTimesheetses_1(Set<Timesheets> timesheetses_1) {
this.timesheetses_1 = timesheetses_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<TaskAllocation> getTaskAllocations_1() {
return this.taskAllocations_1;
}
public void setTaskAllocations_1(Set<TaskAllocation> taskAllocations_1) {
this.taskAllocations_1 = taskAllocations_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<WorkLog> getWorkLogs_1() {
return this.workLogs_1;
}
public void setWorkLogs_1(Set<WorkLog> workLogs_1) {
this.workLogs_1 = workLogs_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<TaskAllocation> getTaskAllocations_2() {
return this.taskAllocations_2;
}
public void setTaskAllocations_2(Set<TaskAllocation> taskAllocations_2) {
this.taskAllocations_2 = taskAllocations_2;
}
}
When I am trying to insert some values through the ui, it shows the following exceptions, "Not Null property refers to a null or transient value", I am including exceptions and My java bean class, Please suggest me some solutions.
Thanks in advance.
-----------------------------------------------------------------
Exception are
FATAL [application] /TasksEdit.xhtml @196,69 action="#{tasksHome.persist}": javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.domain.Portal.entity.Tasks.description1
javax.faces.el.EvaluationException: /TasksEdit.xhtml @196,69 action="#{tasksHome.persist}": javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.domain.Portal.entity.Tasks.description1
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
---------------------------------
Java bean is as follows
--------------------------
@Entity
@Table(name = "TASKS", schema = "dbo", catalog = "PORTALNEW")
public class Tasks implements java.io.Serializable {
private int id;
private TaskStatus taskStatus;
private Projects projects;
private Tasks tasks;
private TaskType taskType;
private String taskId;
private String taskTopic;
private String description1;
private double effort;
private Date estimatedStartDate;
private Date estimatedEndDate;
private Date actualStartDate;
private Date actualEndDate;
private String createdBy;
private Date createdDate;
private String modifiedBy;
private Date modifiedDate;
private Set<Tasks> taskses = new HashSet<Tasks>(0);
private Set<TaskAllocation> taskAllocations = new HashSet<TaskAllocation>(0);
private Set<WorkLog> workLogs = new HashSet<WorkLog>(0);
private Set<Timesheets> timesheetses = new HashSet<Timesheets>(0);
private Set<Tasks> taskses_1 = new HashSet<Tasks>(0);
private Set<Timesheets> timesheetses_1 = new HashSet<Timesheets>(0);
private Set<TaskAllocation> taskAllocations_1 = new HashSet<TaskAllocation>(
0);
private Set<WorkLog> workLogs_1 = new HashSet<WorkLog>(0);
private Set<TaskAllocation> taskAllocations_2 = new HashSet<TaskAllocation>(
0);
public Tasks() {
}
public Tasks(int id, TaskStatus taskStatus, String taskId,
String taskTopic, String description1, double effort,
String createdBy, Date createdDate, String modifiedBy,
Date modifiedDate) {
this.id = id;
this.taskStatus = taskStatus;
this.taskId = taskId;
this.taskTopic = taskTopic;
this.description1 = description1;
this.effort = effort;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.modifiedBy = modifiedBy;
this.modifiedDate = modifiedDate;
}
public Tasks(int id, TaskStatus taskStatus, Projects projects, Tasks tasks,
TaskType taskType, String taskId, String taskTopic,
String description1, double effort, Date estimatedStartDate,
Date estimatedEndDate, Date actualStartDate, Date actualEndDate,
String createdBy, Date createdDate, String modifiedBy,
Date modifiedDate, Set<Tasks> taskses,
Set<TaskAllocation> taskAllocations, Set<WorkLog> workLogs,
Set<Timesheets> timesheetses, Set<Tasks> taskses_1,
Set<Timesheets> timesheetses_1,
Set<TaskAllocation> taskAllocations_1, Set<WorkLog> workLogs_1,
Set<TaskAllocation> taskAllocations_2) {
this.id = id;
this.taskStatus = taskStatus;
this.projects = projects;
this.tasks = tasks;
this.taskType = taskType;
this.taskId = taskId;
this.taskTopic = taskTopic;
this.description1 = description1;
this.effort = effort;
this.estimatedStartDate = estimatedStartDate;
this.estimatedEndDate = estimatedEndDate;
this.actualStartDate = actualStartDate;
this.actualEndDate = actualEndDate;
this.createdBy = createdBy;
this.createdDate = createdDate;
this.modifiedBy = modifiedBy;
this.modifiedDate = modifiedDate;
this.taskses = taskses;
this.taskAllocations = taskAllocations;
this.workLogs = workLogs;
this.timesheetses = timesheetses;
this.taskses_1 = taskses_1;
this.timesheetses_1 = timesheetses_1;
this.taskAllocations_1 = taskAllocations_1;
this.workLogs_1 = workLogs_1;
this.taskAllocations_2 = taskAllocations_2;
}
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name = "ID", unique = true, nullable = false)
@NotNull
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "STATUS", nullable = false)
@NotNull
public TaskStatus getTaskStatus() {
return this.taskStatus;
}
public void setTaskStatus(TaskStatus taskStatus) {
this.taskStatus = taskStatus;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PROJECT_ID")
public Projects getProjects() {
return this.projects;
}
public void setProjects(Projects projects) {
this.projects = projects;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "PARENT_ID")
public Tasks getTasks() {
return this.tasks;
}
public void setTasks(Tasks tasks) {
this.tasks = tasks;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "TYPE")
public TaskType getTaskType() {
return this.taskType;
}
public void setTaskType(TaskType taskType) {
this.taskType = taskType;
}
@Column(name = "TASK_ID", nullable = false, length = 10)
@NotNull
@Length(max = 10)
public String getTaskId() {
return this.taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId;
}
@Column(name = "TASK_TOPIC", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getTaskTopic() {
return this.taskTopic;
}
public void setTaskTopic(String taskTopic) {
this.taskTopic = taskTopic;
}
@Column(name = "DESCRIPTION1", nullable = false, length = 1024)
@NotNull
@Length(max = 1024)
public String getDescription1() {
return this.description1;
}
public void setDescription1(String description1) {
this.description1 = description1;
}
@Column(name = "EFFORT", nullable = false, precision = 53, scale = 0)
@NotNull
public double getEffort() {
return this.effort;
}
public void setEffort(double effort) {
this.effort = effort;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ESTIMATED_START_DATE", length = 23)
public Date getEstimatedStartDate() {
return this.estimatedStartDate;
}
public void setEstimatedStartDate(Date estimatedStartDate) {
this.estimatedStartDate = estimatedStartDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ESTIMATED_END_DATE", length = 23)
public Date getEstimatedEndDate() {
return this.estimatedEndDate;
}
public void setEstimatedEndDate(Date estimatedEndDate) {
this.estimatedEndDate = estimatedEndDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ACTUAL_START_DATE", length = 23)
public Date getActualStartDate() {
return this.actualStartDate;
}
public void setActualStartDate(Date actualStartDate) {
this.actualStartDate = actualStartDate;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "ACTUAL_END_DATE", length = 23)
public Date getActualEndDate() {
return this.actualEndDate;
}
public void setActualEndDate(Date actualEndDate) {
this.actualEndDate = actualEndDate;
}
@Column(name = "CREATED_BY", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getCreatedBy() {
return this.createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "CREATED_DATE", nullable = false, length = 23)
@NotNull
public Date getCreatedDate() {
return this.createdDate;
}
public void setCreatedDate(Date createdDate) {
this.createdDate = createdDate;
}
@Column(name = "MODIFIED_BY", nullable = false, length = 50)
@NotNull
@Length(max = 50)
public String getModifiedBy() {
return this.modifiedBy;
}
public void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "MODIFIED_DATE", nullable = false, length = 23)
@NotNull
public Date getModifiedDate() {
return this.modifiedDate;
}
public void setModifiedDate(Date modifiedDate) {
this.modifiedDate = modifiedDate;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Tasks> getTaskses() {
return this.taskses;
}
public void setTaskses(Set<Tasks> taskses) {
this.taskses = taskses;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<TaskAllocation> getTaskAllocations() {
return this.taskAllocations;
}
public void setTaskAllocations(Set<TaskAllocation> taskAllocations) {
this.taskAllocations = taskAllocations;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<WorkLog> getWorkLogs() {
return this.workLogs;
}
public void setWorkLogs(Set<WorkLog> workLogs) {
this.workLogs = workLogs;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Timesheets> getTimesheetses() {
return this.timesheetses;
}
public void setTimesheetses(Set<Timesheets> timesheetses) {
this.timesheetses = timesheetses;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Tasks> getTaskses_1() {
return this.taskses_1;
}
public void setTaskses_1(Set<Tasks> taskses_1) {
this.taskses_1 = taskses_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<Timesheets> getTimesheetses_1() {
return this.timesheetses_1;
}
public void setTimesheetses_1(Set<Timesheets> timesheetses_1) {
this.timesheetses_1 = timesheetses_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<TaskAllocation> getTaskAllocations_1() {
return this.taskAllocations_1;
}
public void setTaskAllocations_1(Set<TaskAllocation> taskAllocations_1) {
this.taskAllocations_1 = taskAllocations_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<WorkLog> getWorkLogs_1() {
return this.workLogs_1;
}
public void setWorkLogs_1(Set<WorkLog> workLogs_1) {
this.workLogs_1 = workLogs_1;
}
@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tasks")
public Set<TaskAllocation> getTaskAllocations_2() {
return this.taskAllocations_2;
}
public void setTaskAllocations_2(Set<TaskAllocation> taskAllocations_2) {
this.taskAllocations_2 = taskAllocations_2;
}
}