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 | |
---|
1 | package com.ether.dao; |
---|
2 | |
---|
3 | import com.ether.Parameter; |
---|
4 | import com.ether.Plateform; |
---|
5 | import com.ether.PersistenceException; |
---|
6 | import org.hibernate.criterion.DetachedCriteria; |
---|
7 | import org.hibernate.criterion.Restrictions; |
---|
8 | import org.jetbrains.annotations.NotNull; |
---|
9 | import org.jetbrains.annotations.Nullable; |
---|
10 | |
---|
11 | import java.util.List; |
---|
12 | |
---|
13 | /** |
---|
14 | * @author vmipsl |
---|
15 | * @date may 2011 |
---|
16 | * Example for a DAO |
---|
17 | */ |
---|
18 | public 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.