create会重写创建表

update不会

2, one to many

https://www.cnblogs.com/bella-fly/articles/5114182.html

 

3, cache

first level cache, session scope

second-level  cache, shading,

 

 

 

 @Cacheable, @Cache(usage=CacheConcurrencyStrategy.readonly

 eh cached, 要下载jar,注意和hibernate版本一样

query cache

在property指出,在语句指出,q1.setCachealbe(true)

4,lifecycle

hibernate初印象

 

transient:刚刚创建出来的状态

persistent:

  • 调用了session的save/ saveOrUpdate/ get/ load/ list方法
  • 数据库对应, known as dirty checking in hibernate.
  • 受session管理

detach:session关闭后

 

 5,get and load

when we don't use data, get method still hit the database

load give you a proxy, with throw a exception

6, 4步

hibernate初印象

 

 

 1,语句

2,createQuery

3, setParameter

4, getResult

自增主键

hibernate初印象

use-new-id-generator-mappings: false, 这个没用

hibernate初印象

 

 

 

面试答题:https://www.javatpoint.com/hibernate-interview-questions

相关文章:

  • 2021-10-11
  • 2021-09-01
  • 2021-07-02
  • 2022-12-23
  • 2021-10-10
  • 2021-05-09
  • 2021-10-13
  • 2022-01-28
猜你喜欢
  • 2021-06-29
  • 2021-08-31
  • 2022-01-17
  • 2021-06-12
  • 2021-09-09
  • 2021-04-29
  • 2021-08-22
相关资源
相似解决方案