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

com.jpattern.orm.JPO Maven / Gradle / Ivy

The newest version!
package com.jpattern.orm;

import java.util.List;
import java.util.concurrent.ConcurrentHashMap;

import com.jpattern.orm.cache.CacheManager;
import com.jpattern.orm.cache.SimpleCacheManager;
import com.jpattern.orm.exception.OrmConfigurationException;
import com.jpattern.orm.exception.OrmException;
import com.jpattern.orm.persistor.type.ExtendedTypeWrapper;
import com.jpattern.orm.session.Session;
import com.jpattern.orm.validator.NullValidatorService;
import com.jpattern.orm.validator.ValidatorService;

/**
 * 
 * @author Francesco Cina
 *
 * 21/mag/2011
 */
public interface JPO {

    /**
     * Return a session from the current IJPOrm implementation
     * @return
     */
    Session session() throws OrmException;

    /**
     * Destroy the current IJPOrm instance and all it's references.
     */
    void destory();

    /**
     * Register a new class to be managed as a bean.
     * 
     * @param 
     * @param clazz
     * @throws OrmConfigurationException
     */
     void register(Class clazz) throws OrmConfigurationException;

    /**
     * Register a list of classes to be managed as a beans.
     * 
     * @param 
     * @param clazz
     * @throws OrmConfigurationException
     */
    void register(List> classes) throws OrmConfigurationException;

    /**
     * Register a new TypeWrapper.
     * If a TypeWrapper wraps a Class that is already mapped, the last registered TypeWrapper will be used.
     * 
     * @param typeWrapper
     * @throws OrmConfigurationException
     */
    void register(ExtendedTypeWrapper typeWrapper) throws OrmConfigurationException;

    /**
     * Set the {@link ValidatorService}.
     * The default one is {@link NullValidatorService} that performs no validation.
     * @param validator
     */
    void setValidatorService(ValidatorService validator);

    /**
     * Set the {@link CacheManager}.
     * The default is {@link SimpleCacheManager} that uses {@link ConcurrentHashMap} as simple cache system.
     * @param cacheManager
     */
    void setCacheManager(CacheManager cacheManager);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy