package com.atlassian.stash.internal.setting;

import com.atlassian.stash.internal.AbstractHibernateDao;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.Collections;

/**
 * @since 3.2
 */
@Repository("sharedLobDao")
public class HibernateSharedLobDao extends AbstractHibernateDao<Long, InternalSharedLob> implements SharedLobDao {

    @Autowired
    public HibernateSharedLobDao(SessionFactory sessionFactory) {
        super(sessionFactory);
    }

    @Override
    protected Iterable<Order> getImplicitOrder() {
        return Collections.singleton(Order.asc("id"));
    }
}
