Hi Guys,
I have been using hibernate since recent time and facing this problem now after porting JPA specific functionality to hibernate.
I have below class:
Code:
package hibernate;
import java.util.Collections;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import hibernate.Configlist;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.JoinColumn;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import org.hibernate.annotations.AccessType;
import javax.persistence.OneToOne;
import com.google.gson.annotations.SerializedName;
import java.util.Date;
import javax.persistence.FetchType;
import java.sql.Timestamp;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.envers.Audited;
import javax.persistence.PostLoad;
@Entity(name = "Device")
@Audited
@Table(name = "Device")
@AccessType("property")
public class Device {
private List<Configlist> _configlist;
private java.lang.String _host;
@OneToMany(cascade = CascadeType.ALL,fetch=FetchType.EAGER)
@JoinColumn(name = "DEVICE_ID")
public List<Configlist> getConfiglist() {
return _configlist;
}
@Column(name="Host")
public java.lang.String getHost() {
return _host;
}
public Device setHost(java.lang.String value) {
if (value != null) {
check_hostLength(value);
}
this._host = value;
return this;
}
private transient long id;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name="OId")
public long getId() {
return id;
}
public void setId(long id) {
this.id=id;
}
}
Now while writing query for
Host, it is throwning InValidSQLStatement saying 'Host' is not found.
could you please let me know how exactly i can write HQL in this case.
Any lead would be helpful
Thank you in advance.
Regards
Keshav