View Javadoc
1   /*
2    * Copyright (c) 2002-2020, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  
35  package fr.paris.lutece.plugins.bornecineraire.business;
36  
37  import java.sql.Statement;
38  import java.util.ArrayList;
39  import java.util.List;
40  
41  import fr.paris.lutece.portal.service.plugin.Plugin;
42  import fr.paris.lutece.util.ReferenceList;
43  import fr.paris.lutece.util.sql.DAOUtil;
44  
45  /**
46   * This class provides Data Access methods for Defunt objects
47   */
48  public final class DefuntDAO implements IDefuntDAO
49  {
50      // Constants
51      private static final String SQL_QUERY_SELECT           = "SELECT id_defunt, tri_cimetiere, id_pers_ankou, nom_patronymique, nom_marital, nom_usage, nom_concatene, prenom_un, prenom_deux, prenom_trois, prenom_concatene, date_naissance, jour_naissance, mois_naissance, annee_naissance, date_deces, jour_deces, mois_deces, annee_deces, date_inhumation, jour_inhumation, mois_inhumation, annee_inhumation, date_dispersion, jour_dispersion, mois_dispersion, annee_dispersion, commune_deces, emplacement, ST_AsGeoJSON(ST_Transform(geolocalisation, 2154)) as geolocalisation, geolocalisation_x, geolocalisation_y FROM bornecineraire_defunt WHERE id_defunt = ?";
52      private static final String SQL_QUERY_INSERT           = "INSERT INTO bornecineraire_defunt ( id_defunt, tri_cimetiere, id_pers_ankou, nom_patronymique, nom_marital, nom_usage, nom_concatene, prenom_un, prenom_deux, prenom_trois, prenom_concatene, date_naissance, jour_naissance, mois_naissance, annee_naissance, date_deces, jour_deces, mois_deces, annee_deces, date_inhumation, jour_inhumation, mois_inhumation, annee_inhumation, date_dispersion, jour_dispersion, mois_dispersion, annee_dispersion, commune_deces, emplacement, geolocalisation, geolocalisation_x, geolocalisation_y ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? ) ";
53      private static final String SQL_QUERY_DELETE           = "DELETE FROM bornecineraire_defunt WHERE id_defunt = ? ";
54      private static final String SQL_QUERY_UPDATE           = "UPDATE bornecineraire_defunt SET id_defunt = ?, tri_cimetiere = ?, id_pers_ankou = ?, nom_patronymique = ?, nom_marital = ?, nom_usage = ?, nom_concatene = ?, prenom_un = ?, prenom_deux = ?, prenom_trois = ?, prenom_concatene = ?, date_naissance = ?, jour_naissance = ?, mois_naissance = ?, annee_naissance = ?, date_deces = ?, jour_deces = ?, mois_deces = ?, annee_deces = ?, date_inhumation = ?, jour_inhumation = ?, mois_inhumation = ?, annee_inhumation = ?, date_dispersion = ?, jour_dispersion = ?, mois_dispersion = ?, annee_dispersion = ?, commune_deces = ?, emplacement = ?, geolocalisation = ?, geolocalisation_x = ?, geolocalisation_y = ? WHERE id_defunt = ?";
55      private static final String SQL_QUERY_SELECTALL        = "SELECT id_defunt, tri_cimetiere, id_pers_ankou, nom_patronymique, nom_marital, nom_usage, nom_concatene, prenom_un, prenom_deux, prenom_trois, prenom_concatene, date_naissance, jour_naissance, mois_naissance, annee_naissance, date_deces, jour_deces, mois_deces, annee_deces, date_inhumation, jour_inhumation, mois_inhumation, annee_inhumation, date_dispersion, jour_dispersion, mois_dispersion, annee_dispersion, commune_deces, emplacement, ST_AsGeoJSON(ST_Transform(geolocalisation, 2154)) as geolocalisation, geolocalisation_x, geolocalisation_y FROM bornecineraire_defunt";
56      private static final String SQL_QUERY_SELECTALL_ID     = "SELECT id_defunt FROM bornecineraire_defunt";
57      private static final String SQL_QUERY_FIND_ALL_DEFUNTS = "SELECT id_defunt, tri_cimetiere, id_pers_ankou, nom_patronymique, nom_marital, nom_usage, nom_concatene, prenom_un, prenom_deux, prenom_trois, prenom_concatene, date_naissance, jour_naissance, mois_naissance, annee_naissance, date_deces, jour_deces, mois_deces, annee_deces, date_inhumation, jour_inhumation, mois_inhumation, annee_inhumation, date_dispersion, jour_dispersion, mois_dispersion, annee_dispersion, commune_deces, emplacement, ST_AsGeoJSON(ST_Transform(geolocalisation, 2154)) as geolocalisation, geolocalisation_x, geolocalisation_y FROM bornecineraire_defunt WHERE true ";
58  
59      /**
60       * {@inheritDoc }
61       */
62      @Override
63      public void insert( Defunt defunt, Plugin plugin )
64      {
65          DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, Statement.RETURN_GENERATED_KEYS, plugin );
66          try
67          {
68              int nIndex = 1;
69              daoUtil.setInt( nIndex++, defunt.getId( ) );
70              daoUtil.setString( nIndex++, defunt.getTriCimetiere( ) );
71              daoUtil.setInt( nIndex++, defunt.getIdPersAnkou( ) );
72              daoUtil.setString( nIndex++, defunt.getNomPatronymique( ) );
73              daoUtil.setString( nIndex++, defunt.getNomMarital( ) );
74              daoUtil.setString( nIndex++, defunt.getNomUsage( ) );
75              daoUtil.setString( nIndex++, defunt.getNomConcatene( ) );
76              daoUtil.setString( nIndex++, defunt.getPrenomUn( ) );
77              daoUtil.setString( nIndex++, defunt.getPrenomDeux( ) );
78              daoUtil.setString( nIndex++, defunt.getPrenomTrois( ) );
79              daoUtil.setString( nIndex++, defunt.getPrenomConcatene( ) );
80              daoUtil.setDate( nIndex++, defunt.getDateNaissance( ) );
81              daoUtil.setInt( nIndex++, defunt.getJourNaissance( ) );
82              daoUtil.setInt( nIndex++, defunt.getMoisNaissance( ) );
83              daoUtil.setInt( nIndex++, defunt.getAnneeNaissance( ) );
84              daoUtil.setDate( nIndex++, defunt.getDateDeces( ) );
85              daoUtil.setInt( nIndex++, defunt.getJourDeces( ) );
86              daoUtil.setInt( nIndex++, defunt.getMoisDeces( ) );
87              daoUtil.setInt( nIndex++, defunt.getAnneeDeces( ) );
88              daoUtil.setDate( nIndex++, defunt.getDateInhumation( ) );
89              daoUtil.setInt( nIndex++, defunt.getJourInhumation( ) );
90              daoUtil.setInt( nIndex++, defunt.getMoisInhumation( ) );
91              daoUtil.setInt( nIndex++, defunt.getAnneeInhumation( ) );
92              daoUtil.setDate( nIndex++, defunt.getDateDispersion( ) );
93              daoUtil.setInt( nIndex++, defunt.getJourDispersion( ) );
94              daoUtil.setInt( nIndex++, defunt.getMoisDispersion( ) );
95              daoUtil.setInt( nIndex++, defunt.getAnneeDispersion( ) );
96              daoUtil.setString( nIndex++, defunt.getCommuneDeces( ) );
97              daoUtil.setString( nIndex++, defunt.getEmplacement( ) );
98              daoUtil.setString( nIndex++, defunt.getGeolocalisation( ) );
99              daoUtil.setString( nIndex++, defunt.getGeolocalisationX( ) );
100             daoUtil.setString( nIndex++, defunt.getGeolocalisationY( ) );
101 
102             daoUtil.executeUpdate( );
103             if ( daoUtil.nextGeneratedKey( ) )
104             {
105                 defunt.setId( daoUtil.getGeneratedKeyInt( 1 ) );
106             }
107         } finally
108         {
109             daoUtil.free( );
110         }
111     }
112 
113     /**
114      * {@inheritDoc }
115      */
116     @Override
117     public Defunt load( int nKey, Plugin plugin )
118     {
119         DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECT, plugin );
120         daoUtil.setInt( 1, nKey );
121         daoUtil.executeQuery( );
122         Defunt defunt = null;
123 
124         if ( daoUtil.next( ) )
125         {
126             defunt = new Defunt( );
127             int nIndex = 1;
128 
129             defunt.setId( daoUtil.getInt( nIndex++ ) );
130             defunt.setTriCimetiere( daoUtil.getString( nIndex++ ) );
131             defunt.setIdPersAnkou( daoUtil.getInt( nIndex++ ) );
132             defunt.setNomPatronymique( daoUtil.getString( nIndex++ ) );
133             defunt.setNomMarital( daoUtil.getString( nIndex++ ) );
134             defunt.setNomUsage( daoUtil.getString( nIndex++ ) );
135             defunt.setNomConcatene( daoUtil.getString( nIndex++ ) );
136             defunt.setPrenomUn( daoUtil.getString( nIndex++ ) );
137             defunt.setPrenomDeux( daoUtil.getString( nIndex++ ) );
138             defunt.setPrenomTrois( daoUtil.getString( nIndex++ ) );
139             defunt.setPrenomConcatene( daoUtil.getString( nIndex++ ) );
140             defunt.setDateNaissance( daoUtil.getDate( nIndex++ ) );
141             defunt.setJourNaissance( daoUtil.getInt( nIndex++ ) );
142             defunt.setMoisNaissance( daoUtil.getInt( nIndex++ ) );
143             defunt.setAnneeNaissance( daoUtil.getInt( nIndex++ ) );
144             defunt.setDateDeces( daoUtil.getDate( nIndex++ ) );
145             defunt.setJourDeces( daoUtil.getInt( nIndex++ ) );
146             defunt.setMoisDeces( daoUtil.getInt( nIndex++ ) );
147             defunt.setAnneeDeces( daoUtil.getInt( nIndex++ ) );
148             defunt.setDateInhumation( daoUtil.getDate( nIndex++ ) );
149             defunt.setJourInhumation( daoUtil.getInt( nIndex++ ) );
150             defunt.setMoisInhumation( daoUtil.getInt( nIndex++ ) );
151             defunt.setAnneeInhumation( daoUtil.getInt( nIndex++ ) );
152             defunt.setDateDispersion( daoUtil.getDate( nIndex++ ) );
153             defunt.setJourDispersion( daoUtil.getInt( nIndex++ ) );
154             defunt.setMoisDispersion( daoUtil.getInt( nIndex++ ) );
155             defunt.setAnneeDispersion( daoUtil.getInt( nIndex++ ) );
156             defunt.setCommuneDeces( daoUtil.getString( nIndex++ ) );
157             defunt.setEmplacement( daoUtil.getString( nIndex++ ) );
158             defunt.setGeolocalisation( daoUtil.getString( nIndex++ ) );
159             defunt.setGeolocalisationX( daoUtil.getString( nIndex++ ) );
160             defunt.setGeolocalisationY( daoUtil.getString( nIndex++ ) );
161         }
162 
163         daoUtil.free( );
164         return defunt;
165     }
166 
167     /**
168      * {@inheritDoc }
169      */
170     @Override
171     public void delete( int nKey, Plugin plugin )
172     {
173         DAOUtil daoUtil = new DAOUtil( SQL_QUERY_DELETE, plugin );
174         daoUtil.setInt( 1, nKey );
175         daoUtil.executeUpdate( );
176         daoUtil.free( );
177     }
178 
179     /**
180      * {@inheritDoc }
181      */
182     @Override
183     public void store( Defunt defunt, Plugin plugin )
184     {
185         DAOUtil daoUtil = new DAOUtil( SQL_QUERY_UPDATE, plugin );
186         int nIndex = 1;
187 
188         daoUtil.setInt( nIndex++, defunt.getId( ) );
189         daoUtil.setString( nIndex++, defunt.getTriCimetiere( ) );
190         daoUtil.setInt( nIndex++, defunt.getIdPersAnkou( ) );
191         daoUtil.setString( nIndex++, defunt.getNomPatronymique( ) );
192         daoUtil.setString( nIndex++, defunt.getNomMarital( ) );
193         daoUtil.setString( nIndex++, defunt.getNomUsage( ) );
194         daoUtil.setString( nIndex++, defunt.getNomConcatene( ) );
195         daoUtil.setString( nIndex++, defunt.getPrenomUn( ) );
196         daoUtil.setString( nIndex++, defunt.getPrenomDeux( ) );
197         daoUtil.setString( nIndex++, defunt.getPrenomTrois( ) );
198         daoUtil.setString( nIndex++, defunt.getPrenomConcatene( ) );
199         daoUtil.setDate( nIndex++, defunt.getDateNaissance( ) );
200         daoUtil.setInt( nIndex++, defunt.getJourNaissance( ) );
201         daoUtil.setInt( nIndex++, defunt.getMoisNaissance( ) );
202         daoUtil.setInt( nIndex++, defunt.getAnneeNaissance( ) );
203         daoUtil.setDate( nIndex++, defunt.getDateDeces( ) );
204         daoUtil.setInt( nIndex++, defunt.getJourDeces( ) );
205         daoUtil.setInt( nIndex++, defunt.getMoisDeces( ) );
206         daoUtil.setInt( nIndex++, defunt.getAnneeDeces( ) );
207         daoUtil.setDate( nIndex++, defunt.getDateInhumation( ) );
208         daoUtil.setInt( nIndex++, defunt.getJourInhumation( ) );
209         daoUtil.setInt( nIndex++, defunt.getMoisInhumation( ) );
210         daoUtil.setInt( nIndex++, defunt.getAnneeInhumation( ) );
211         daoUtil.setDate( nIndex++, defunt.getDateDispersion( ) );
212         daoUtil.setInt( nIndex++, defunt.getJourDispersion( ) );
213         daoUtil.setInt( nIndex++, defunt.getMoisDispersion( ) );
214         daoUtil.setInt( nIndex++, defunt.getAnneeDispersion( ) );
215         daoUtil.setString( nIndex++, defunt.getCommuneDeces( ) );
216         daoUtil.setString( nIndex++, defunt.getEmplacement( ) );
217         daoUtil.setString( nIndex++, defunt.getGeolocalisation( ) );
218         daoUtil.setString( nIndex++, defunt.getGeolocalisationX( ) );
219         daoUtil.setString( nIndex++, defunt.getGeolocalisationY( ) );
220         daoUtil.setInt( nIndex, defunt.getId( ) );
221 
222         daoUtil.executeUpdate( );
223         daoUtil.free( );
224     }
225 
226     /**
227      * {@inheritDoc }
228      */
229     @Override
230     public List<Defunt> selectDefuntsList( Plugin plugin )
231     {
232         List<Defunt> defuntList = new ArrayList<Defunt>( );
233         DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
234         daoUtil.executeQuery( );
235 
236         while ( daoUtil.next( ) )
237         {
238             Defunt defunt = new Defunt( );
239             int nIndex = 1;
240 
241             defunt.setId( daoUtil.getInt( nIndex++ ) );
242             defunt.setTriCimetiere( daoUtil.getString( nIndex++ ) );
243             defunt.setIdPersAnkou( daoUtil.getInt( nIndex++ ) );
244             defunt.setNomPatronymique( daoUtil.getString( nIndex++ ) );
245             defunt.setNomMarital( daoUtil.getString( nIndex++ ) );
246             defunt.setNomUsage( daoUtil.getString( nIndex++ ) );
247             defunt.setNomConcatene( daoUtil.getString( nIndex++ ) );
248             defunt.setPrenomUn( daoUtil.getString( nIndex++ ) );
249             defunt.setPrenomDeux( daoUtil.getString( nIndex++ ) );
250             defunt.setPrenomTrois( daoUtil.getString( nIndex++ ) );
251             defunt.setPrenomConcatene( daoUtil.getString( nIndex++ ) );
252             defunt.setDateNaissance( daoUtil.getDate( nIndex++ ) );
253             defunt.setJourNaissance( daoUtil.getInt( nIndex++ ) );
254             defunt.setMoisNaissance( daoUtil.getInt( nIndex++ ) );
255             defunt.setAnneeNaissance( daoUtil.getInt( nIndex++ ) );
256             defunt.setDateDeces( daoUtil.getDate( nIndex++ ) );
257             defunt.setJourDeces( daoUtil.getInt( nIndex++ ) );
258             defunt.setMoisDeces( daoUtil.getInt( nIndex++ ) );
259             defunt.setAnneeDeces( daoUtil.getInt( nIndex++ ) );
260             defunt.setDateInhumation( daoUtil.getDate( nIndex++ ) );
261             defunt.setJourInhumation( daoUtil.getInt( nIndex++ ) );
262             defunt.setMoisInhumation( daoUtil.getInt( nIndex++ ) );
263             defunt.setAnneeInhumation( daoUtil.getInt( nIndex++ ) );
264             defunt.setDateDispersion( daoUtil.getDate( nIndex++ ) );
265             defunt.setJourDispersion( daoUtil.getInt( nIndex++ ) );
266             defunt.setMoisDispersion( daoUtil.getInt( nIndex++ ) );
267             defunt.setAnneeDispersion( daoUtil.getInt( nIndex++ ) );
268             defunt.setCommuneDeces( daoUtil.getString( nIndex++ ) );
269             defunt.setEmplacement( daoUtil.getString( nIndex++ ) );
270             defunt.setGeolocalisation( daoUtil.getString( nIndex++ ) );
271             defunt.setGeolocalisationX( daoUtil.getString( nIndex++ ) );
272             defunt.setGeolocalisationY( daoUtil.getString( nIndex++ ) );
273 
274             defuntList.add( defunt );
275         }
276 
277         daoUtil.free( );
278         return defuntList;
279     }
280 
281     /**
282      * {@inheritDoc }
283      */
284     @Override
285     public List<Integer> selectIdDefuntsList( Plugin plugin )
286     {
287         List<Integer> defuntList = new ArrayList<Integer>( );
288         DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL_ID, plugin );
289         daoUtil.executeQuery( );
290 
291         while ( daoUtil.next( ) )
292         {
293             defuntList.add( daoUtil.getInt( 1 ) );
294         }
295 
296         daoUtil.free( );
297         return defuntList;
298     }
299 
300     /**
301      * {@inheritDoc }
302      */
303     @Override
304     public ReferenceList selectDefuntsReferenceList( Plugin plugin )
305     {
306         ReferenceList defuntList = new ReferenceList( );
307         DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
308         daoUtil.executeQuery( );
309 
310         while ( daoUtil.next( ) )
311         {
312             defuntList.addItem( daoUtil.getInt( 1 ), daoUtil.getString( 2 ) );
313         }
314 
315         daoUtil.free( );
316         return defuntList;
317     }
318 
319     /**
320      * {@inheritDoc }
321      */
322     @Override
323     public List<Defunt> getListeDefunts( Recherche recherche, Plugin plugin )
324     {
325         Defunt defuntToFind = recherche.getDefunt( );
326         boolean isExtendSearch = recherche.isEtendu( );
327         String trigramme = recherche.getTrigrammeCimetiere( );
328 
329         String nomToFind = defuntToFind.getNomConcatene( );
330         String prenomToFind = defuntToFind.getPrenomConcatene( );
331         int jourNaissanceToFind = defuntToFind.getJourNaissance( );
332         int moisNaissanceToFind = defuntToFind.getMoisNaissance( );
333         int anneeNaissanceToFind = defuntToFind.getAnneeNaissance( );
334         int jourInhumToFind = defuntToFind.getJourInhumation( );
335         int moisInhumToFind = defuntToFind.getMoisInhumation( );
336         int anneeInhumToFind = defuntToFind.getAnneeInhumation( );
337 
338         StringBuilder requete = new StringBuilder( SQL_QUERY_FIND_ALL_DEFUNTS );
339 
340         if ( ( trigramme != null ) || !"".equals( trigramme ) )
341         {
342             requete.append( "AND tri_cimetiere = '" + trigramme.toUpperCase( ) + "' " );
343         }
344 
345         if ( nomToFind != null )
346         {
347             if ( isExtendSearch )
348             {
349                 requete.append( "AND (nom_marital like '%" + nomToFind + "%' OR nom_patronymique like '%" + nomToFind + "%' OR nom_usage like '%" + nomToFind + "%') " );
350             } else
351             {
352                 requete.append( "AND (nom_marital='" + nomToFind + "' OR nom_patronymique='" + nomToFind + "' OR nom_usage='" + nomToFind + "') " );
353             }
354         }
355         if ( prenomToFind != null )
356         {
357             requete.append( "AND (prenom_un='" + prenomToFind + "' OR prenom_deux='" + prenomToFind + "' OR prenom_trois='" + prenomToFind + "') " );
358         }
359         if ( jourNaissanceToFind != 0 )
360         {
361             requete.append( "AND (jour_naissance=" + jourNaissanceToFind + ") " );
362         }
363         if ( moisNaissanceToFind != 0 )
364         {
365             requete.append( "AND (mois_naissance=" + moisNaissanceToFind + ") " );
366         }
367         if ( anneeNaissanceToFind != 0 )
368         {
369             requete.append( "AND (annee_naissance=" + anneeNaissanceToFind + ") " );
370         }
371         if ( jourInhumToFind != 0 )
372         {
373             requete.append( "AND (jour_deces=" + jourInhumToFind + " OR jour_inhumation=" + jourInhumToFind + " OR jour_dispersion=" + jourInhumToFind + ") " );
374         }
375         if ( moisInhumToFind != 0 )
376         {
377             requete.append( "AND (mois_deces=" + moisInhumToFind + " OR mois_inhumation=" + moisInhumToFind + " OR mois_dispersion=" + moisInhumToFind + ") " );
378         }
379         if ( anneeInhumToFind != 0 )
380         {
381             requete.append( "AND (annee_deces=" + anneeInhumToFind + " OR annee_inhumation=" + anneeInhumToFind + " OR annee_dispersion=" + anneeInhumToFind + ") " );
382         }
383 
384         requete.append( "ORDER BY nom_patronymique ; " );
385 
386         List<Defunt> defuntList = new ArrayList<Defunt>( );
387         DAOUtil daoUtil = new DAOUtil( requete.toString( ), plugin );
388         daoUtil.executeQuery( );
389 
390         while ( daoUtil.next( ) )
391         {
392             Defunt defunt = new Defunt( );
393             int nIndex = 1;
394 
395             defunt.setId( daoUtil.getInt( nIndex++ ) );
396             defunt.setTriCimetiere( daoUtil.getString( nIndex++ ) );
397             defunt.setIdPersAnkou( daoUtil.getInt( nIndex++ ) );
398             defunt.setNomPatronymique( daoUtil.getString( nIndex++ ) );
399             defunt.setNomMarital( daoUtil.getString( nIndex++ ) );
400             defunt.setNomUsage( daoUtil.getString( nIndex++ ) );
401             defunt.setNomConcatene( daoUtil.getString( nIndex++ ) );
402             defunt.setPrenomUn( daoUtil.getString( nIndex++ ) );
403             defunt.setPrenomDeux( daoUtil.getString( nIndex++ ) );
404             defunt.setPrenomTrois( daoUtil.getString( nIndex++ ) );
405             defunt.setPrenomConcatene( daoUtil.getString( nIndex++ ) );
406             defunt.setDateNaissance( daoUtil.getDate( nIndex++ ) );
407             defunt.setJourNaissance( daoUtil.getInt( nIndex++ ) );
408             defunt.setMoisNaissance( daoUtil.getInt( nIndex++ ) );
409             defunt.setAnneeNaissance( daoUtil.getInt( nIndex++ ) );
410             defunt.setDateDeces( daoUtil.getDate( nIndex++ ) );
411             defunt.setJourDeces( daoUtil.getInt( nIndex++ ) );
412             defunt.setMoisDeces( daoUtil.getInt( nIndex++ ) );
413             defunt.setAnneeDeces( daoUtil.getInt( nIndex++ ) );
414             defunt.setDateInhumation( daoUtil.getDate( nIndex++ ) );
415             defunt.setJourInhumation( daoUtil.getInt( nIndex++ ) );
416             defunt.setMoisInhumation( daoUtil.getInt( nIndex++ ) );
417             defunt.setAnneeInhumation( daoUtil.getInt( nIndex++ ) );
418             defunt.setDateDispersion( daoUtil.getDate( nIndex++ ) );
419             defunt.setJourDispersion( daoUtil.getInt( nIndex++ ) );
420             defunt.setMoisDispersion( daoUtil.getInt( nIndex++ ) );
421             defunt.setAnneeDispersion( daoUtil.getInt( nIndex++ ) );
422             defunt.setCommuneDeces( daoUtil.getString( nIndex++ ) );
423             defunt.setEmplacement( daoUtil.getString( nIndex++ ) );
424             defunt.setGeolocalisation( daoUtil.getString( nIndex++ ) );
425             defunt.setGeolocalisationX( daoUtil.getString( nIndex++ ) );
426             defunt.setGeolocalisationY( daoUtil.getString( nIndex++ ) );
427 
428             defuntList.add( defunt );
429         }
430 
431         daoUtil.free( );
432         return defuntList;
433     }
434 }