Deprecated createCriteria method in Hibernate 5

后端 未结 4 942
陌清茗
陌清茗 2020-11-29 02:11

This calling is deprecated:

session.createCriteria(Bus.class).list();

In source files I can see this:

/** @deprecated */
@D         


        
4条回答
  •  北海茫月
    2020-11-29 03:03

    from the API documentation:

    @Deprecated Criteria createCriteria(Class persistentClass) Deprecated. (since 5.2) for Session, use the JPA Criteria Create Criteria instance for the given class (entity or subclasses/implementors). Parameters: persistentClass - The class, which is an entity, or has entity subclasses/implementors Returns: The criteria instance for manipulation and execution

    So it briefly says to...

    use the JPA Criteria Create Criteria

提交回复
热议问题