zoukankan      html  css  js  c++  java
  • [Hibernate] official tutorial

    Persistence contexts

    org.hibernate.Session API and javax.persistence.EntityManager API represent a context for dealing with persistent data. This concept is called  apersistencec context. Persistent data has a state in relation to both a persistence context and the underlying database.

    transient瞬时

    The entity has just been instantiated and is not assocaiated with a persistence context.

    It has no persistent representation in the database and typically no identifier value has been assigned(unless the assigned generator was used).

    managed, or persistent 持久的]

    实体有一个关联的标识符,并且和持久化上下文关联.

    物理地存在或者不存在于数据库中.

    detached 托管的,游离的

    有关联的标识符,但是不再和持久化上下滑关联(通常因为持久化上下文被关闭或者实例被上下文清除.

    removed

    实体有关联的标识符并且和持久化上下文关联,然而它被计划从数据库中移除.

    大多数org.hibernate.Session API and javax.persistence.EntityManager API的方法处理实体在这些状态之间的变动.

    -------------从JPA中访问Hibernate APIs--------

    Session session = entityManager.unwrap( Session.class );
    SessionImplementor sessionImplementor = entityManager.unwrap( SessionImplementor.class );
    
    SessionFactory sessionFactory = entityManager.getEntityManagerFactory().unwrap( SessionFactory.class );
    ----------------

    宛如智障,暗藏锋芒
  • 相关阅读:
    hdoj:2033
    hdoj:2032
    hdoj:2031
    hdoj:2029
    hdoj:2028
    hdoj:2027
    hdoj:2024
    hdoj:2023
    hdoj:2022
    hdoj:题目分类
  • 原文地址:https://www.cnblogs.com/zienzir/p/9176543.html
Copyright © 2011-2022 走看看