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

de.terrestris.shoguncore.dao.MapDao Maven / Gradle / Ivy

There is a newer version: 5.3.13
Show newest version
package de.terrestris.shoguncore.dao;

import de.terrestris.shoguncore.model.layer.Layer;
import de.terrestris.shoguncore.model.module.Map;
import org.hibernate.HibernateException;
import org.springframework.stereotype.Repository;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

@Repository("mapDao")
public class MapDao extends
    ModuleDao {

    /**
     * Public default constructor for this DAO.
     */
    @SuppressWarnings("unchecked")
    public MapDao() {
        super((Class) Map.class);
    }

    /**
     * Constructor that has to be called by subclasses.
     *
     * @param clazz
     */
    protected MapDao(Class clazz) {
        super(clazz);
    }

    /**
     *
     */
    public Set findMapsWithLayer(Layer layer) throws HibernateException {
        final List resultList = this.findAllWithCollectionContaining("mapLayers", layer);
        return new HashSet<>(resultList);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy