source: ether_2012/persistence/implementation/com/ether/dao/PlateformDAOImpl.java @ 319

Last change on this file since 319 was 319, checked in by vmipsl, 12 years ago

Import du projet Ether pour le nouveau look 2012

File size: 1.2 KB
Line 
1package com.ether.dao;
2
3import com.ether.Parameter;
4import com.ether.Plateform;
5import com.ether.PersistenceException;
6import org.hibernate.criterion.DetachedCriteria;
7import org.hibernate.criterion.Restrictions;
8import org.jetbrains.annotations.NotNull;
9import org.jetbrains.annotations.Nullable;
10
11import java.util.List;
12
13/**
14 * @author vmipsl
15 * @date may 2011
16 * Example for a DAO
17 */
18public class PlateformDAOImpl
19        extends DomainAccessObjectImpl<Plateform, Integer>
20        implements PlateformDAO
21{
22    protected PlateformDAOImpl()
23    {
24        super( Plateform.class );
25    }
26
27    @Nullable
28    public Plateform getPlateformById( @NotNull final Integer plateformId )
29            throws PersistenceException
30    {
31        final DetachedCriteria criteria = DetachedCriteria.forClass( Plateform.class )
32                .add( Restrictions.idEq( plateformId ) );
33
34        return selectByCriteria( Plateform.class, criteria );
35    }
36
37    @NotNull
38    public List<Plateform> getAllPlateforms()
39            throws PersistenceException
40    {
41        final DetachedCriteria criteria = DetachedCriteria.forClass( Plateform.class );
42        return selectAllByCriteria( Plateform.class, criteria );
43    }
44}
Note: See TracBrowser for help on using the repository browser.