⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mocksessionfactory.java

📁 jbpm demo 是一款非常不错的开源工作流,简单易用,适合扩张开发!
💻 JAVA
字号:
package org.jbpm.persistence.db;

import java.io.Serializable;
import java.sql.Connection;
import java.util.Map;
import java.util.Set;

import javax.naming.NamingException;
import javax.naming.Reference;

import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
import org.hibernate.SessionFactory;
import org.hibernate.StatelessSession;
import org.hibernate.classic.Session;
import org.hibernate.engine.FilterDefinition;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.metadata.CollectionMetadata;
import org.hibernate.stat.Statistics;

public class MockSessionFactory implements SessionFactory {

  private static final long serialVersionUID = 1L;
  
  public Session openSession(Connection connection) {
    return new MockSession(connection);
  }

  public Session openSession() throws HibernateException {
    return new MockSession();
  }

  public Session getCurrentSession() throws HibernateException {
    return null;
  }
  
  ////////////////////////////

  public void close() throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public Session openSession(Interceptor interceptor) throws HibernateException {
    throw new UnsupportedOperationException();
  }
  public Session openSession(Connection connection, Interceptor interceptor) {
    throw new UnsupportedOperationException();
  }

  public ClassMetadata getClassMetadata(Class persistentClass) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public ClassMetadata getClassMetadata(String entityName) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public CollectionMetadata getCollectionMetadata(String roleName) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public Map getAllClassMetadata() throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public Map getAllCollectionMetadata() throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public Statistics getStatistics() {
    throw new UnsupportedOperationException();
  }

  public boolean isClosed() {
    throw new UnsupportedOperationException();
  }

  public void evict(Class persistentClass) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evict(Class persistentClass, Serializable id) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evictEntity(String entityName) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evictEntity(String entityName, Serializable id) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evictCollection(String roleName) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evictCollection(String roleName, Serializable id) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evictQueries() throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public void evictQueries(String cacheRegion) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public StatelessSession openStatelessSession() {
    throw new UnsupportedOperationException();
  }

  public StatelessSession openStatelessSession(Connection connection) {
    throw new UnsupportedOperationException();
  }

  public Set getDefinedFilterNames() {
    throw new UnsupportedOperationException();
  }

  public FilterDefinition getFilterDefinition(String filterName) throws HibernateException {
    throw new UnsupportedOperationException();
  }

  public Reference getReference() throws NamingException {
    throw new UnsupportedOperationException();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -