Bonsoir à tous,j'ai généré la classe persistante d'une vue avec hibernate et alors ce dernier pour cette vue 2 classes la première est la suivante
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 
@Entity
@Table(name = "FORMULAIRE_ACCIDENT_TOTAL")
public class FormulaireAccidentTotal implements java.io.Serializable {
 
	private FormulaireAccidentTotalId id;
 
	public FormulaireAccidentTotal() {
	}
 
	public FormulaireAccidentTotal(FormulaireAccidentTotalId id) {
		this.id = id;
	}
 
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "NOrdre", column = @Column(name = "N_ORDRE", nullable = false, precision = 22, scale = 0)),
			@AttributeOverride(name = "nomManoeuvreAccident", column = @Column(name = "NOM_MANOEUVRE_ACCIDENT")),
			@AttributeOverride(name = "libSurf", column = @Column(name = "LIB_SURF")),
			@AttributeOverride(name = "typeCollision", column = @Column(name = "TYPE_COLLISION")),
			@AttributeOverride(name = "libLum", column = @Column(name = "LIB_LUM")),
			@AttributeOverride(name = "nomTypeIntersection", column = @Column(name = "NOM_TYPE_INTERSECTION")),
			@AttributeOverride(name = "nomProfilLong", column = @Column(name = "NOM_PROFIL_LONG", nullable = false, length = 20)),
			@AttributeOverride(name = "nomTracePlan", column = @Column(name = "NOM_TRACE_PLAN")),
			@AttributeOverride(name = "nomAgent", column = @Column(name = "NOM_AGENT")),
			@AttributeOverride(name = "nomSignalisationVer", column = @Column(name = "NOM_SIGNALISATION_VER")),
			@AttributeOverride(name = "nomSignLum", column = @Column(name = "NOM_SIGN_LUM")),
			@AttributeOverride(name = "libIntemp", column = @Column(name = "LIB_INTEMP")),
			@AttributeOverride(name = "nomNbrVoie", column = @Column(name = "NOM_NBR_VOIE")),
			@AttributeOverride(name = "typeRegulation", column = @Column(name = "TYPE_REGULATION")),
			@AttributeOverride(name = "nomObstacleHeurte", column = @Column(name = "NOM_OBSTACLE_HEURTE")),
			@AttributeOverride(name = "typeCirculation", column = @Column(name = "TYPE_CIRCULATION")),
			@AttributeOverride(name = "nomPointChoc", column = @Column(name = "NOM_POINT_CHOC")),
			@AttributeOverride(name = "typeVoie", column = @Column(name = "TYPE_VOIE")),
			@AttributeOverride(name = "libChaus", column = @Column(name = "LIB_CHAUS")),
			@AttributeOverride(name = "dateHeure", column = @Column(name = "DATE_HEURE", length = 7)),
			@AttributeOverride(name = "villeCommune", column = @Column(name = "VILLE_COMMUNE")),
			@AttributeOverride(name = "totalTues", column = @Column(name = "TOTAL_TUES", precision = 22, scale = 0)),
			@AttributeOverride(name = "totalBlesses", column = @Column(name = "TOTAL_BLESSES", precision = 22, scale = 0)) })
	public FormulaireAccidentTotalId getId() {
		return this.id;
	}
 
	public void setId(FormulaireAccidentTotalId id) {
		this.id = id;
	}
 
}
et la 2eme est comme suite
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
 
package com.logisoft.classes;
 
// Generated 24 mai 2013 11:03:13 by Hibernate Tools 3.4.0.CR1
 
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Embeddable;
 
/**
 * FormulaireAccidentTotalId generated by hbm2java
 */
@SuppressWarnings("serial")
@Embeddable
public class FormulaireAccidentTotalId implements java.io.Serializable {
 
	private BigDecimal NOrdre;
	private String nomManoeuvreAccident;
	private String libSurf;
	private String typeCollision;
	private String libLum;
	private String nomTypeIntersection;
	private String nomProfilLong;
	private String nomTracePlan;
	private String nomAgent;
	private String nomSignalisationVer;
	private String nomSignLum;
	private String libIntemp;
	private String nomNbrVoie;
	private String typeRegulation;
	private String nomObstacleHeurte;
	private String typeCirculation;
	private String nomPointChoc;
	private String typeVoie;
	private String libChaus;
	private Date dateHeure;
	private String villeCommune;
	private BigDecimal totalTues;
	private BigDecimal totalBlesses;
 
	public FormulaireAccidentTotalId() {
	}
 
	public FormulaireAccidentTotalId(BigDecimal NOrdre, String nomProfilLong) {
		this.NOrdre = NOrdre;
		this.nomProfilLong = nomProfilLong;
	}
 
	public FormulaireAccidentTotalId(BigDecimal NOrdre,
			String nomManoeuvreAccident, String libSurf, String typeCollision,
			String libLum, String nomTypeIntersection, String nomProfilLong,
			String nomTracePlan, String nomAgent, String nomSignalisationVer,
			String nomSignLum, String libIntemp, String nomNbrVoie,
			String typeRegulation, String nomObstacleHeurte, String typeCirculation,
			String nomPointChoc, String typeVoie, String libChaus, Date dateHeure,
			String villeCommune, BigDecimal totalTues, BigDecimal totalBlesses) {
		this.NOrdre = NOrdre;
		this.nomManoeuvreAccident = nomManoeuvreAccident;
		this.libSurf = libSurf;
		this.typeCollision = typeCollision;
		this.libLum = libLum;
		this.nomTypeIntersection = nomTypeIntersection;
		this.nomProfilLong = nomProfilLong;
		this.nomTracePlan = nomTracePlan;
		this.nomAgent = nomAgent;
		this.nomSignalisationVer = nomSignalisationVer;
		this.nomSignLum = nomSignLum;
		this.libIntemp = libIntemp;
		this.nomNbrVoie = nomNbrVoie;
		this.typeRegulation = typeRegulation;
		this.nomObstacleHeurte = nomObstacleHeurte;
		this.typeCirculation = typeCirculation;
		this.nomPointChoc = nomPointChoc;
		this.typeVoie = typeVoie;
		this.libChaus = libChaus;
		this.dateHeure = dateHeure;
		this.villeCommune = villeCommune;
		this.totalTues = totalTues;
		this.totalBlesses = totalBlesses;
	}
 
	@Column(name = "N_ORDRE", nullable = false, precision = 22, scale = 0)
	public BigDecimal getNOrdre() {
		return this.NOrdre;
	}
 
	public void setNOrdre(BigDecimal NOrdre) {
		this.NOrdre = NOrdre;
	}
 
	@Column(name = "NOM_MANOEUVRE_ACCIDENT")
	public String getNomManoeuvreAccident() {
		return this.nomManoeuvreAccident;
	}
 
	public void setNomManoeuvreAccident(String nomManoeuvreAccident) {
		this.nomManoeuvreAccident = nomManoeuvreAccident;
	}
 
	@Column(name = "LIB_SURF")
	public String getLibSurf() {
		return this.libSurf;
	}
 
	public void setLibSurf(String libSurf) {
		this.libSurf = libSurf;
	}
 
	@Column(name = "TYPE_COLLISION")
	public String getTypeCollision() {
		return this.typeCollision;
	}
 
	public void setTypeCollision(String typeCollision) {
		this.typeCollision = typeCollision;
	}
 
	@Column(name = "LIB_LUM")
	public String getLibLum() {
		return this.libLum;
	}
 
	public void setLibLum(String libLum) {
		this.libLum = libLum;
	}
 
	@Column(name = "NOM_TYPE_INTERSECTION")
	public String getNomTypeIntersection() {
		return this.nomTypeIntersection;
	}
 
	public void setNomTypeIntersection(String nomTypeIntersection) {
		this.nomTypeIntersection = nomTypeIntersection;
	}
 
	@Column(name = "NOM_PROFIL_LONG", nullable = false, length = 20)
	public String getNomProfilLong() {
		return this.nomProfilLong;
	}
 
	public void setNomProfilLong(String nomProfilLong) {
		this.nomProfilLong = nomProfilLong;
	}
 
	@Column(name = "NOM_TRACE_PLAN")
	public String getNomTracePlan() {
		return this.nomTracePlan;
	}
 
	public void setNomTracePlan(String nomTracePlan) {
		this.nomTracePlan = nomTracePlan;
	}
 
	@Column(name = "NOM_AGENT")
	public String getNomAgent() {
		return this.nomAgent;
	}
 
	public void setNomAgent(String nomAgent) {
		this.nomAgent = nomAgent;
	}
 
	@Column(name = "NOM_SIGNALISATION_VER")
	public String getNomSignalisationVer() {
		return this.nomSignalisationVer;
	}
 
	public void setNomSignalisationVer(String nomSignalisationVer) {
		this.nomSignalisationVer = nomSignalisationVer;
	}
 
	@Column(name = "NOM_SIGN_LUM")
	public String getNomSignLum() {
		return this.nomSignLum;
	}
 
	public void setNomSignLum(String nomSignLum) {
		this.nomSignLum = nomSignLum;
	}
 
	@Column(name = "LIB_INTEMP")
	public String getLibIntemp() {
		return this.libIntemp;
	}
 
	public void setLibIntemp(String libIntemp) {
		this.libIntemp = libIntemp;
	}
 
	@Column(name = "NOM_NBR_VOIE")
	public String getNomNbrVoie() {
		return this.nomNbrVoie;
	}
 
	public void setNomNbrVoie(String nomNbrVoie) {
		this.nomNbrVoie = nomNbrVoie;
	}
 
	@Column(name = "TYPE_REGULATION")
	public String getTypeRegulation() {
		return this.typeRegulation;
	}
 
	public void setTypeRegulation(String typeRegulation) {
		this.typeRegulation = typeRegulation;
	}
 
	@Column(name = "NOM_OBSTACLE_HEURTE")
	public String getNomObstacleHeurte() {
		return this.nomObstacleHeurte;
	}
 
	public void setNomObstacleHeurte(String nomObstacleHeurte) {
		this.nomObstacleHeurte = nomObstacleHeurte;
	}
 
	@Column(name = "TYPE_CIRCULATION")
	public String getTypeCirculation() {
		return this.typeCirculation;
	}
 
	public void setTypeCirculation(String typeCirculation) {
		this.typeCirculation = typeCirculation;
	}
 
	@Column(name = "NOM_POINT_CHOC")
	public String getNomPointChoc() {
		return this.nomPointChoc;
	}
 
	public void setNomPointChoc(String nomPointChoc) {
		this.nomPointChoc = nomPointChoc;
	}
 
	@Column(name = "TYPE_VOIE")
	public String getTypeVoie() {
		return this.typeVoie;
	}
 
	public void setTypeVoie(String typeVoie) {
		this.typeVoie = typeVoie;
	}
 
	@Column(name = "LIB_CHAUS")
	public String getLibChaus() {
		return this.libChaus;
	}
 
	public void setLibChaus(String libChaus) {
		this.libChaus = libChaus;
	}
 
	@Column(name = "DATE_HEURE", length = 7)
	public Date getDateHeure() {
		return this.dateHeure;
	}
 
	public void setDateHeure(Date dateHeure) {
		this.dateHeure = dateHeure;
	}
 
	@Column(name = "VILLE_COMMUNE")
	public String getVilleCommune() {
		return this.villeCommune;
	}
 
	public void setVilleCommune(String villeCommune) {
		this.villeCommune = villeCommune;
	}
 
	@Column(name = "TOTAL_TUES", precision = 22, scale = 0)
	public BigDecimal getTotalTues() {
		return this.totalTues;
	}
 
	public void setTotalTues(BigDecimal totalTues) {
		this.totalTues = totalTues;
	}
 
	@Column(name = "TOTAL_BLESSES", precision = 22, scale = 0)
	public BigDecimal getTotalBlesses() {
		return this.totalBlesses;
	}
 
	public void setTotalBlesses(BigDecimal totalBlesses) {
		this.totalBlesses = totalBlesses;
	}
 
	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof FormulaireAccidentTotalId))
			return false;
		FormulaireAccidentTotalId castOther = (FormulaireAccidentTotalId) other;
 
		return ((this.getNOrdre() == castOther.getNOrdre()) || (this
				.getNOrdre() != null && castOther.getNOrdre() != null && this
				.getNOrdre().equals(castOther.getNOrdre())))
				&& ((this.getNomManoeuvreAccident() == castOther
						.getNomManoeuvreAccident()) || (this
						.getNomManoeuvreAccident() != null
						&& castOther.getNomManoeuvreAccident() != null && this
						.getNomManoeuvreAccident().equals(
								castOther.getNomManoeuvreAccident())))
				&& ((this.getLibSurf() == castOther.getLibSurf()) || (this
						.getLibSurf() != null && castOther.getLibSurf() != null && this
						.getLibSurf().equals(castOther.getLibSurf())))
				&& ((this.getTypeCollision() == castOther.getTypeCollision()) || (this
						.getTypeCollision() != null
						&& castOther.getTypeCollision() != null && this
						.getTypeCollision()
						.equals(castOther.getTypeCollision())))
				&& ((this.getLibLum() == castOther.getLibLum()) || (this
						.getLibLum() != null && castOther.getLibLum() != null && this
						.getLibLum().equals(castOther.getLibLum())))
				&& ((this.getNomTypeIntersection() == castOther
						.getNomTypeIntersection()) || (this
						.getNomTypeIntersection() != null
						&& castOther.getNomTypeIntersection() != null && this
						.getNomTypeIntersection().equals(
								castOther.getNomTypeIntersection())))
				&& ((this.getNomProfilLong() == castOther.getNomProfilLong()) || (this
						.getNomProfilLong() != null
						&& castOther.getNomProfilLong() != null && this
						.getNomProfilLong()
						.equals(castOther.getNomProfilLong())))
				&& ((this.getNomTracePlan() == castOther.getNomTracePlan()) || (this
						.getNomTracePlan() != null
						&& castOther.getNomTracePlan() != null && this
						.getNomTracePlan().equals(castOther.getNomTracePlan())))
				&& ((this.getNomAgent() == castOther.getNomAgent()) || (this
						.getNomAgent() != null
						&& castOther.getNomAgent() != null && this
						.getNomAgent().equals(castOther.getNomAgent())))
				&& ((this.getNomSignalisationVer() == castOther
						.getNomSignalisationVer()) || (this
						.getNomSignalisationVer() != null
						&& castOther.getNomSignalisationVer() != null && this
						.getNomSignalisationVer().equals(
								castOther.getNomSignalisationVer())))
				&& ((this.getNomSignLum() == castOther.getNomSignLum()) || (this
						.getNomSignLum() != null
						&& castOther.getNomSignLum() != null && this
						.getNomSignLum().equals(castOther.getNomSignLum())))
				&& ((this.getLibIntemp() == castOther.getLibIntemp()) || (this
						.getLibIntemp() != null
						&& castOther.getLibIntemp() != null && this
						.getLibIntemp().equals(castOther.getLibIntemp())))
				&& ((this.getNomNbrVoie() == castOther.getNomNbrVoie()) || (this
						.getNomNbrVoie() != null
						&& castOther.getNomNbrVoie() != null && this
						.getNomNbrVoie().equals(castOther.getNomNbrVoie())))
				&& ((this.getTypeRegulation() == castOther.getTypeRegulation()) || (this
						.getTypeRegulation() != null
						&& castOther.getTypeRegulation() != null && this
						.getTypeRegulation().equals(
								castOther.getTypeRegulation())))
				&& ((this.getNomObstacleHeurte() == castOther
						.getNomObstacleHeurte()) || (this
						.getNomObstacleHeurte() != null
						&& castOther.getNomObstacleHeurte() != null && this
						.getNomObstacleHeurte().equals(
								castOther.getNomObstacleHeurte())))
				&& ((this.getTypeCirculation() == castOther
						.getTypeCirculation()) || (this.getTypeCirculation() != null
						&& castOther.getTypeCirculation() != null && this
						.getTypeCirculation().equals(
								castOther.getTypeCirculation())))
				&& ((this.getNomPointChoc() == castOther.getNomPointChoc()) || (this
						.getNomPointChoc() != null
						&& castOther.getNomPointChoc() != null && this
						.getNomPointChoc().equals(castOther.getNomPointChoc())))
				&& ((this.getTypeVoie() == castOther.getTypeVoie()) || (this
						.getTypeVoie() != null
						&& castOther.getTypeVoie() != null && this
						.getTypeVoie().equals(castOther.getTypeVoie())))
				&& ((this.getLibChaus() == castOther.getLibChaus()) || (this
						.getLibChaus() != null
						&& castOther.getLibChaus() != null && this
						.getLibChaus().equals(castOther.getLibChaus())))
				&& ((this.getDateHeure() == castOther.getDateHeure()) || (this
						.getDateHeure() != null
						&& castOther.getDateHeure() != null && this
						.getDateHeure().equals(castOther.getDateHeure())))
				&& ((this.getVilleCommune() == castOther.getVilleCommune()) || (this
						.getVilleCommune() != null
						&& castOther.getVilleCommune() != null && this
						.getVilleCommune().equals(castOther.getVilleCommune())))
				&& ((this.getTotalTues() == castOther.getTotalTues()) || (this
						.getTotalTues() != null
						&& castOther.getTotalTues() != null && this
						.getTotalTues().equals(castOther.getTotalTues())))
				&& ((this.getTotalBlesses() == castOther.getTotalBlesses()) || (this
						.getTotalBlesses() != null
						&& castOther.getTotalBlesses() != null && this
						.getTotalBlesses().equals(castOther.getTotalBlesses())));
	}
 
	public int hashCode() {
		int result = 17;
 
		result = 37 * result
				+ (getNOrdre() == null ? 0 : this.getNOrdre().hashCode());
		result = 37
				* result
				+ (getNomManoeuvreAccident() == null ? 0 : this
						.getNomManoeuvreAccident().hashCode());
		result = 37 * result
				+ (getLibSurf() == null ? 0 : this.getLibSurf().hashCode());
		result = 37
				* result
				+ (getTypeCollision() == null ? 0 : this.getTypeCollision()
						.hashCode());
		result = 37 * result
				+ (getLibLum() == null ? 0 : this.getLibLum().hashCode());
		result = 37
				* result
				+ (getNomTypeIntersection() == null ? 0 : this
						.getNomTypeIntersection().hashCode());
		result = 37
				* result
				+ (getNomProfilLong() == null ? 0 : this.getNomProfilLong()
						.hashCode());
		result = 37
				* result
				+ (getNomTracePlan() == null ? 0 : this.getNomTracePlan()
						.hashCode());
		result = 37 * result
				+ (getNomAgent() == null ? 0 : this.getNomAgent().hashCode());
		result = 37
				* result
				+ (getNomSignalisationVer() == null ? 0 : this
						.getNomSignalisationVer().hashCode());
		result = 37
				* result
				+ (getNomSignLum() == null ? 0 : this.getNomSignLum()
						.hashCode());
		result = 37 * result
				+ (getLibIntemp() == null ? 0 : this.getLibIntemp().hashCode());
		result = 37
				* result
				+ (getNomNbrVoie() == null ? 0 : this.getNomNbrVoie()
						.hashCode());
		result = 37
				* result
				+ (getTypeRegulation() == null ? 0 : this.getTypeRegulation()
						.hashCode());
		result = 37
				* result
				+ (getNomObstacleHeurte() == null ? 0 : this
						.getNomObstacleHeurte().hashCode());
		result = 37
				* result
				+ (getTypeCirculation() == null ? 0 : this.getTypeCirculation()
						.hashCode());
		result = 37
				* result
				+ (getNomPointChoc() == null ? 0 : this.getNomPointChoc()
						.hashCode());
		result = 37 * result
				+ (getTypeVoie() == null ? 0 : this.getTypeVoie().hashCode());
		result = 37 * result
				+ (getLibChaus() == null ? 0 : this.getLibChaus().hashCode());
		result = 37 * result
				+ (getDateHeure() == null ? 0 : this.getDateHeure().hashCode());
		result = 37
				* result
				+ (getVilleCommune() == null ? 0 : this.getVilleCommune()
						.hashCode());
		result = 37 * result
				+ (getTotalTues() == null ? 0 : this.getTotalTues().hashCode());
		result = 37
				* result
				+ (getTotalBlesses() == null ? 0 : this.getTotalBlesses()
						.hashCode());
		return result;
	}
 
}
j'ai crée une classe service pour la manipulation des données de la vue,moi je teste maintenant la récupération des données seulement,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
 
package com.logisoft.service;
 
import java.math.BigDecimal;
import java.util.List;
 
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
 
import com.logisoft.classes.FormulaireAccident;
import com.logisoft.classes.FormulaireAccidentTotal;
import com.logisoft.classes.FormulaireAccidentTotal;
 
@Service("formulaireAccidentTotalService")
@Transactional
public class FormulaireAccidentTotalServiceImpl implements
		FormulaireAccidentTotalService {
	@Autowired
	private SessionFactory sessionFactory;
	@SuppressWarnings("unchecked")
	@Override
	public List<FormulaireAccidentTotal> findAll() {
		// TODO Auto-generated method stub
		return sessionFactory.getCurrentSession().createQuery("from FormulaireAccidentTotal").list();
 
	}
 
	@Override
	public FormulaireAccidentTotal findById(String nordre) {
		// TODO Auto-generated method stub
		return null;
	}
 
	@Override
	public void save(FormulaireAccidentTotal formulaire) {
		// TODO Auto-generated method stub
 
	}
 
 
 
}
à l'aide de jUnit j'essaye d'afficher les elements de ma vue mais ca me donne toujours des erreurs,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
 
package com.logisoft.service;
 
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
 
import java.math.BigDecimal;
import java.sql.Clob;
import java.sql.SQLException;
import java.util.List;
import java.util.Set;
 
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;
 
import com.logisoft.classes.Agent;
import com.logisoft.classes.Conducteur;
import com.logisoft.classes.FormulaireAccidentTotal;
import com.logisoft.classes.FormulaireAccidentTotal;
import com.logisoft.classes.ManoeuvrePieton;
import com.logisoft.classes.SignalisationLumineuse;
import com.logisoft.classes.FormulaireAccident;
import com.logisoft.classes.GendarmerieRoyale;
import com.logisoft.classes.SureteNationale;
 
public class AgentServiceTest {
	private static ClassPathXmlApplicationContext context;
	private static FormulaireAccidentTotalService formulaireAccidentTotalService;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		context=new ClassPathXmlApplicationContext("application-contexte.xml");
		formulaireAccidentTotalService=(FormulaireAccidentTotalService) context.getBean("formulaireAccidentTotalService");
	}
 
	@AfterClass
	public static void tearDownAfterClass() throws Exception {
		context.close();
	}
		@Test
	public void testFindAll() {
		List<FormulaireAccidentTotal> allManoeuvrePieton = formulaireAccidentTotalService.findAll();
		assertNotNull(allManoeuvrePieton);
		assertTrue(allManoeuvrePieton.size()>0);
		System.out.println(allManoeuvrePieton.size());
		System.out.println(allManoeuvrePieton.get(0).getId().getLibChaus());
	System.out.println(allManoeuvrePieton.get(1).getNomFaute()+" "+allManoeuvrePieton.get(1).getFaute());
	}
}
pour le 1er println il m'affiche 1 ce qui est juste ma vue a seulement un enregistrement alors que pour le 2 eme affichage il me donne une erreur java.Lang.NullPointerException