ejb 3.0 entities
Hi,
I am new to ejb 3.0
In my application,I have program written for entity.I deployed ejb on server.I am trying to store values into database.
I am getting this error on the server.
Column not found in any table in the query (or SLV is not defined).
I am not using any query for storing the values.What is SLV here?
What I need to do?What am I missing here?
Can anybody help me?
Thanks.
[442 byte] By [
sam_123a] at [2007-11-27 7:46:47]

Here is my entity class:
import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.util.Date;
@Entity
public class Locationcalendar implements Serializable {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private int loccalendarid;
//private Object locstartdatetime;
@Temporal(TemporalType.TIMESTAMP)
private Date locstartdatetime;
//private Object locenddatetime;
@Temporal(TemporalType.TIMESTAMP)
private Date locenddatetime;
@ManyToOne
@JoinColumn(name="recurrenceid")
private Recurrence recurrenceid;
//@ManyToOne
//@JoinColumns({
//@JoinColumn(name="appttypeid", referencedColumnName="appttypeid"),
//@JoinColumn(name="apptsubtypeid", referencedColumnName="apptsubtypeid")
//})
@ManyToOne
@JoinColumns({
@JoinColumn(name="appttypeid", referencedColumnName="appttypeid",insertable=false, updatable=false),
@JoinColumn(name="apptsubtypeid", referencedColumnName="apptsubtypeid",insertable=false, updatable=false)
})
private RAppttype rAppttype;
@ManyToOne
@JoinColumn(name="locationid")
private SVendor locationid;
private int appttypeid;
private int apptsubtypeid;
private static final long serialVersionUID = 1;
public Locationcalendar() {
super();
}
public int getLoccalendarid() {
return this.loccalendarid;
}
public void setLoccalendarid(int loccalendarid) {
this.loccalendarid = loccalendarid;
}
public Date getLocstartdatetime() {
return this.locstartdatetime;
}
public void setLocstartdatetime(Date locstartdatetime) {
this.locstartdatetime = locstartdatetime;
}
public Date getLocenddatetime() {
return this.locenddatetime;
}
public void setLocenddatetime(Date locenddatetime) {
this.locenddatetime = locenddatetime;
}
public Recurrence getRecurrenceid() {
return this.recurrenceid;
}
public void setRecurrenceid(Recurrence recurrenceid) {
this.recurrenceid = recurrenceid;
}
public RAppttype getRAppttype() {
return this.rAppttype;
}
public void setRAppttype(RAppttype rAppttype) {
this.rAppttype = rAppttype;
}
public SVendor getLocationid() {
return this.locationid;
}
public void setLocationid(SVendor locationid) {
this.locationid = locationid;
}
public int getAppttypeid() {
return this.appttypeid;
}
public void setAppttypeid(int appttypeid) {
this.appttypeid = appttypeid;
}
public int getApptsubtypeid() {
return this.apptsubtypeid;
}
public void setApptsubtypeid(int apptsubtypeid) {
this.apptsubtypeid = apptsubtypeid;
}
}
I have added the last four methods since i need it.then it started showing the error I gave you in prevous post.
Thanks.
Which tables are you trying to join? Now you have only one table named Locationcalendar.
Beacuse as i know each entity class points to only one table.
I will give you here one some code snippets about Joining columns.
Customer (@ManyToOne)-->(@OneToMany) Address
Customer
@Entity
@Table(name = "CUSTOMER")
public class Customer
implements Serializable
{
private String email;
@Id
@Column(nullable = false)
@GeneratedValue(generator = "SequenceIdGenerator")
private Long id;
@ManyToOne(cascade = { CascadeType.ALL })
@JoinColumn(name = "ADDRESS", referencedColumnName = "ID")
private Address shippingAddress;
private Address billingAddress;
Address
@Entity
@Table(name = "ADDRESS")
public class Address
implements Serializable
{
private String city;
@Id
@Column(nullable = false)
@GeneratedValue(generator = "SequenceIdGenerator")
private Long id;
private String state;
private String street1;
private String street2;
private Long version;
@OneToMany(mappedBy = "shippingAddress")
private List<Customer> shippingCustomers;
Hope it will help.
Gantua at 2007-7-12 19:27:45 >
