All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.babyfish.hibernate.XSession Maven / Gradle / Ivy

The newest version!
/*
 * BabyFish, Object Model Framework for Java and JPA.
 * https://github.com/babyfish-ct/babyfish
 *
 * Copyright (c) 2008-2015, Tao Chen
 *
 * This copyrighted material is made available to anyone wishing to use, modify,
 * copy, or redistribute it subject to the terms and conditions of the GNU
 * Lesser General Public License, as published by the Free Software Foundation.
 *
 * Please visit "http://opensource.org/licenses/LGPL-3.0" to know more.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 * for more details.
 */
package org.babyfish.hibernate;

import java.io.Serializable;
import java.util.List;

import org.babyfish.persistence.path.QueryPath;
import org.babyfish.persistence.path.TypedQueryPath;
import org.hibernate.HibernateException;
import org.hibernate.LockOptions;
import org.hibernate.Session;

/**
 * @author Tao Chen
 */
public interface XSession extends Session {
    
    @Override
    XSessionFactory getSessionFactory();
    
    Object get(String entityName, Serializable id, String ... queryPaths);
    
    Object get(String entityName, Serializable id, LockOptions lockOptions, String ... queryPaths);
    
    Object get(String entityName, Serializable id, QueryPath ... queryPaths);
    
    @SuppressWarnings("unchecked")
     E get(Class entityClass, Serializable id, TypedQueryPath ... queryPaths);
    
    Object get(String entityName, Serializable id, LockOptions lockOptions, QueryPath ... queryPaths);
    
    @SuppressWarnings("unchecked")
     E get(Class entityClass, Serializable id, LockOptions lockOptions, TypedQueryPath ... queryPaths);
    
    List get(String entityName, Iterable ids, String ... queryPaths);
    
    List get(String entityName, Iterable ids, LockOptions lockOptions, String ... queryPaths);
    
    List get(String entityName, Iterable ids, QueryPath ... queryPaths);
    
    @SuppressWarnings("unchecked")
     List get(Class entityClass, Iterable ids, TypedQueryPath ... queryPaths);
    
    List get(String entityName, Iterable ids, LockOptions lockOptions, QueryPath ... queryPaths);
    
    @SuppressWarnings("unchecked")
     List get(Class entityClass, Iterable ids, LockOptions lockOptions, TypedQueryPath ... queryPaths);

    @Override
    XSharedSessionBuilder sessionWithOptions();
    
    @Override
    XQuery createQuery(String queryString) throws HibernateException;
    
    @Override
    XQuery getNamedQuery(String queryName) throws HibernateException;
}