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

org.jboss.pressgang.ccms.provider.DBTranslatedCSNodeStringProvider Maven / Gradle / Ivy

package org.jboss.pressgang.ccms.provider;

import javax.persistence.EntityManager;
import java.util.ArrayList;
import java.util.List;

import org.jboss.pressgang.ccms.model.contentspec.TranslatedCSNodeString;
import org.jboss.pressgang.ccms.provider.listener.ProviderListener;
import org.jboss.pressgang.ccms.wrapper.TranslatedCSNodeStringWrapper;
import org.jboss.pressgang.ccms.wrapper.TranslatedCSNodeWrapper;
import org.jboss.pressgang.ccms.wrapper.collection.CollectionWrapper;
import org.jboss.pressgang.ccms.wrapper.collection.UpdateableCollectionWrapper;

public class DBTranslatedCSNodeStringProvider extends DBDataProvider implements TranslatedCSNodeStringProvider {
    protected DBTranslatedCSNodeStringProvider(EntityManager entityManager, DBProviderFactory providerFactory, List listeners) {
        super(entityManager, providerFactory, listeners);
    }

    @Override
    public CollectionWrapper getTranslatedCSNodeStringRevisions(int id, Integer revision) {
        final List revisions = getRevisionList(TranslatedCSNodeString.class, id);
        return getWrapperFactory().createCollection(revisions, TranslatedCSNodeString.class, revision != null);
    }

    @Override
    public TranslatedCSNodeStringWrapper newTranslatedCSNodeString(TranslatedCSNodeWrapper parent) {
        return getWrapperFactory().create(new TranslatedCSNodeString(), false);
    }

    @Override
    public UpdateableCollectionWrapper newTranslatedCSNodeStringCollection(TranslatedCSNodeWrapper parent) {
        final CollectionWrapper collection = getWrapperFactory().createCollection(
                new ArrayList(), TranslatedCSNodeString.class, false);

        return (UpdateableCollectionWrapper) collection;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy