I have a very simple scenario. Customers can have 1 to many logs. The main log key is an identity column. The log table has a customer_id.
Why would I be getting this error?
Code:
package org.domain.dillans.entity;
// Generated Jan 13, 2009 7:12:06 PM by Hibernate Tools 3.2.4.CR1
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
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;
/**
* CustomerLog generated by hbm2java
*/
@Entity
@Table(name = "customer_log")
public class CustomerLog implements java.io.Serializable {
private Integer customerLogId;
private Customer customer;
private Date logDate;
private String logText;
public CustomerLog() {
}
public CustomerLog(Customer customer) {
this.customer = customer;
}
public CustomerLog(Customer customer, Date logDate, String logText) {
this.customer = customer;
this.logDate = logDate;
this.logText = logText;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "customer_log_id", unique = true, nullable = false)
public Integer getCustomerLogId() {
return this.customerLogId;
}
public void setCustomerLogId(Integer customerLogId) {
this.customerLogId = customerLogId;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "customer_id", nullable = false)
@NotNull
public Customer getCustomer() {
return this.customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "log_date", length = 19)
public Date getLogDate() {
return this.logDate;
}
public void setLogDate(Date logDate) {
this.logDate = logDate;
}
@Column(name = "log_text", length = 65535)
@Length(max = 65535)
public String getLogText() {
return this.logText;
}
public void setLogText(String logText) {
this.logText = logText;
}
}