I have a question regarding load
method of Hibernate.
from the below code fragments, the first one throws ObjectNotFoundException
where as the second one, simply returns a proxy. what is the difference between annotating @Id
at field level and annotating at getter method() level
1)
class Test {
@Id
private long id;
}
2)
class Test {
private long id;
@Id
public long getId() {
return id;
}
}
Thank you all
regards sivakiran B