Reputation: 23
There is no association in the entity shown below.
Does hibernate use proxy object to retrieve the User object?
The question is little bit same as this one.
But what if there is no associations?
@Entity
@Table(name="user")
public class User {
@Id
@GeneratedValue
private int id;
private String name;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
Upvotes: 1
Views: 60
Reputation: 19956
Use this to test for proxy
boolean proxy = user instanceof HibernateProxy;
Upvotes: 1