Example usage for javax.persistence EntityManagerFactory unwrap

List of usage examples for javax.persistence EntityManagerFactory unwrap

Introduction

In this page you can find the example usage for javax.persistence EntityManagerFactory unwrap.

Prototype

public <T> T unwrap(Class<T> cls);

Source Link

Document

Return an object of the specified type to allow access to the provider-specific API.

Usage

From source file:com.supermy.base.service.WebMetaService.java

@Autowired
public WebMetaService(EntityManagerFactory factory) {
    if (factory.unwrap(SessionFactory.class) == null) {
        throw new NullPointerException("factory is not a hibernate factory");
    }//  w  w w.  j a  va  2s . c o  m
    this.sessionfactory = factory.unwrap(SessionFactory.class);
}