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

org.nuiton.topia.it.legacy.AbstractTopiaItLegacyTopiaApplicationContext Maven / Gradle / Ivy

The newest version!
package org.nuiton.topia.it.legacy;

/*-
 * #%L
 * ToPIA :: IT
 * %%
 * Copyright (C) 2004 - 2024 Code Lutin
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * 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 General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * .
 * #L%
 */

import java.util.Map;
import java.util.Properties;
import java.util.Set;
import org.nuiton.topia.persistence.TopiaConfiguration;
import org.nuiton.topia.persistence.TopiaEntity;
import org.nuiton.topia.persistence.TopiaEntityEnumProvider;
import org.nuiton.topia.persistence.internal.AbstractTopiaPersistenceContextConstructorParameter;
import org.nuiton.topia.persistence.util.EntityOperator;

public abstract class AbstractTopiaItLegacyTopiaApplicationContext extends AbstractTopiaItLegacyApplicationContext implements TopiaItLegacyApplicationContext, TopiaEntityEnumProvider {

    @Deprecated
    protected AbstractTopiaItLegacyTopiaApplicationContext(Properties properties) {
        super(properties);
    }

    @Deprecated
    protected AbstractTopiaItLegacyTopiaApplicationContext(Map configuration) {
        super(configuration);
    }

    protected AbstractTopiaItLegacyTopiaApplicationContext(TopiaConfiguration topiaConfiguration) {
        super(topiaConfiguration);
    }

    @Override
    public TopiaItLegacyTopiaPersistenceContext newPersistenceContext() {

        TopiaItLegacyTopiaPersistenceContext newContext = new TopiaItLegacyTopiaPersistenceContext(
                new AbstractTopiaPersistenceContextConstructorParameter(
                        getHibernateProvider(),
                        getTopiaFiresSupport(),
                        getTopiaIdFactory(),
                        getSessionRegistry(),
                        getConfiguration().getSlowQueriesThreshold()
                )
        );
        registerPersistenceContext(newContext);
        return newContext;
    }

    @Override
    public String getModelVersion() {
        return "1.2";
    }

    @Override
    public String getModelName() {
        return "TopiaItLegacy";
    }

    @Override
    public  Class getContractClass(Class klass) {
        return TopiaItLegacyEntityEnum.getContractClass(klass);
    }

    @Override
    public Class[] getContractClasses() {
        return TopiaItLegacyEntityEnum.getContractClasses();
    }

    @Override
    public  Class getImplementationClass(Class klass) {
        return TopiaItLegacyEntityEnum.getImplementationClass(klass);
    }

    @Override
    public Set> getImplementationClasses() {
        return TopiaItLegacyEntityEnum.getImplementationClasses();
    }

    public TopiaItLegacyEntityEnum[] getContracts() {
        return TopiaItLegacyEntityEnum.getContracts();
    }

    public  EntityOperator getOperator(Class klass) {
        return TopiaItLegacyEntityEnum.getOperator(klass);
    }

    @Override
    public  TopiaItLegacyEntityEnum getEntityEnum(Class type) {
        return TopiaItLegacyEntityEnum.valueOf(type);
    }

    @Override
    public TopiaItLegacyEntityEnum getEntityEnum(String name) {
        return TopiaItLegacyEntityEnum.valueOf(name);
    }

} //AbstractTopiaItLegacyTopiaApplicationContext




© 2015 - 2025 Weber Informatics LLC | Privacy Policy