The method used in session objects Hibernate

Common method of Hibernate in session objects
find (String queryString) query returns a result set list, according to HQL query string to return an instance method will first look for a collection find the cache at the time of execution, if the cache can not be found again find the database, if not find to returns null.
save (Object entity) Add to save the new instance
saveOrUpdate (); add or modify have id is a modified no id is updated
delete (Object entity); Delete to delete the specified persistent instance
update (Object entity); modify the update state of the instance instance persistent state must
instances get (Class entityClass, Serializable id) The ID persistent query specific primary key loading
load (); delay loading the object obtained based on the unique identifier

Guess you like

Origin blog.csdn.net/weixin_45031351/article/details/91038406