Bonjour à tous
Je suis le tutoriel de Serge Tahé:Introduction à Java EE 5 a l'adresse suivante http://tahe.developpez.com/java/javaee/ mais des j'ai des soucis a l’implémentation de la couche métier. J'ai déjà teste la couche Dao, elle s’exécute bien.

L'interface de la classe métier et sont implémentation sont les suivantes:

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
 
package metier;
 
import entites.Employes;
import java.util.List;
 
/**
 *
 * @author Baba
 */
public interface IMetier {
    //obtenir la feuille de salaire
    public FeuilleSalaire CalculerFeuilleSalaire(String SS, double nbHeureTrav, int nbJoursTrav);
    //Liste des employes
    public List<Employes> findAllEmployes();
 
}

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
 
package metier;
 
import dao.ICotisationsDao;
import dao.IEmployesDao;
import dao.IIndemnitesDao;
import entites.Cotisations;
import entites.Employes;
import entites.Indemnites;
import exception.PamException;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;
 
/**
 *
 * @author Baba
 */
@Transactional
public class Metier implements IMetier {
    // reference sur la couche Dao
    private ICotisationsDao cotisationDao = null;
    private IEmployesDao employeDao = null;    
    private IIndemnitesDao indemniteDao = null;
    //private ElementsSalaire elementsSalaire ;
     // getters and setters
 
    public ICotisationsDao getCotisationDao() {
        return cotisationDao;
    }
 
    public void setCotisationDao(ICotisationsDao cotisationDao) {
        this.cotisationDao = cotisationDao;
    }
 
    public IEmployesDao getEmployeDao() {
        return employeDao;
    }
 
    public void setEmployeDao(IEmployesDao employeDao) {
        this.employeDao = employeDao;
    }
 
    public IIndemnitesDao getIndemniteDao() {
        return indemniteDao;
    }
 
    public void setIndemniteDao(IIndemnitesDao indemniteDao) {
        this.indemniteDao = indemniteDao;
    }
 
    @Override
    public FeuilleSalaire CalculerFeuilleSalaire(String SS, double nbHeureTrav, int nbJoursTrav) {
        Employes employes = employeDao.find(SS);
        // on rend une exception si l'employe n'existe pas
 
        if(employes == null) {
            throw new PamException(String.format("L'Employe de n SS n'existe pas", SS),1);
        }
       Cotisations cotisations = (Cotisations) cotisationDao.findAll();
       Indemnites indemnites = (Indemnites) indemniteDao.findAll();
 
       ElementsSalaire  elementsSalaire   = new ElementsSalaire();
       elementsSalaire.getSalaireBase();
       elementsSalaire.getCotisationsSociales();
       elementsSalaire.getIndemnitesEntretiens();
       elementsSalaire.getIndemnitesRepas();
       elementsSalaire.getSalaireNet();
 
       return new FeuilleSalaire(employes, cotisations, elementsSalaire);
 
    }
 
    @Override
    public List<Employes> findAllEmployes() {
        try {
            return employeDao.findAll();
        }catch(Throwable th) {
        throw new PamException(th, 1);
        }
    }  
}
Les deux classes complémentaires dans la couche métier pour le calcul du salaire sont les suivantes:

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
 
package metier;
 
import entites.Cotisations;
import entites.Employes;
import entites.Indemnites;
import java.io.Serializable;
 
/**
 *
 * @author Baba
 */
public class FeuilleSalaire implements Serializable {
    //champs prives
    private Employes employes;
    private Cotisations cotisations;
    private Indemnites indemnites;
    private ElementsSalaire elementsSalaire;
 
    public FeuilleSalaire(){
 
    }
 
    public FeuilleSalaire(Employes employes, Cotisations cotisations, ElementsSalaire elementsSalaire) {
        this.employes = employes;
        this.cotisations = cotisations;
        this.elementsSalaire = elementsSalaire;
    }
 
    public Employes getEmployes() {
        return employes;
    }
 
    public void setEmployes(Employes employes) {
        this.employes = employes;
    }
 
    public Cotisations getCotisations() {
        return cotisations;
    }
 
    public void setCotisations(Cotisations cotisations) {
        this.cotisations = cotisations;
    }
 
    public ElementsSalaire getElemntsSalaire() {
        return elementsSalaire;
    }
 
    public void setElemntsSalaire(ElementsSalaire elemntsSalaire) {
        this.elementsSalaire = elemntsSalaire;
    }
 
    public Indemnites getIndemnites() {
        return indemnites;
    }
 
    public void setIndemnites(Indemnites indemnites) {
        this.indemnites = indemnites;
    }
 
    public ElementsSalaire getElementsSalaire() {
        return elementsSalaire;
    }
 
    public void setElementsSalaire(ElementsSalaire elementsSalaire) {
        this.elementsSalaire = elementsSalaire;
    }
 
 
    //toString
    @Override
    public String toString() {
        return "[" + employes + "," + cotisations + "," + elementsSalaire + "]";
 
    }
 
}
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
 
package metier;
 
import java.io.Serializable;
 
/**
 *
 * @author Baba
 */
public class ElementsSalaire implements Serializable {
    //champs prives
    private double salaireBase;
    private double cotisationsSociales;
    private double indemnitesEntretiens;
    private double indemnitesRepas;
    private double salaireNet;
 
    public ElementsSalaire() {
    }
 
    public ElementsSalaire(double salaireBase, double cotisationsSociales, double indemnitesEntretiens, double indemnitesRepas, double salaireNet) {
        this.salaireBase = salaireBase;
        this.cotisationsSociales = cotisationsSociales;
        this.indemnitesEntretiens = indemnitesEntretiens;
        this.indemnitesRepas = indemnitesRepas;
        this.salaireNet = salaireNet;
    }
 
    public double getSalaireBase() {
        return salaireBase;
    }
 
    public void setSalaireBase(double salaireBase) {
        this.salaireBase = salaireBase;
    }
 
    public double getCotisationsSociales() {
        return cotisationsSociales;
    }
 
    public void setCotisationsSociales(double cotisationsSociales) {
        this.cotisationsSociales = cotisationsSociales;
    }
 
    public double getIndemnitesEntretiens() {
        return indemnitesEntretiens;
    }
 
    public void setIndemnitesEntretiens(double indemnitesEntretiens) {
        this.indemnitesEntretiens = indemnitesEntretiens;
    }
 
    public double getIndemnitesRepas() {
        return indemnitesRepas;
    }
 
    public void setIndemnitesRepas(double indemnitesRepas) {
        this.indemnitesRepas = indemnitesRepas;
    }
 
    public double getSalaireNet() {
        return salaireNet;
    }
 
    public void setSalaireNet(double salaireNet) {
        this.salaireNet = salaireNet;
    }
 
    @Override
    public String toString(){
        return "[Salaire de base = " + salaireBase + ",Cotisations sociales = " + cotisationsSociales +
                ",Indemnites d'entretien = " + indemnitesEntretiens + ", Indemnites de repas = " +indemnitesRepas+
                ", Salaire net = " + salaireNet + "]";
    }
 
}
Ma classe de test est le suivant:

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
 
package metier;
 
import dao.ICotisationsDao;
import dao.IEmployesDao;
import dao.IIndemnitesDao;
import entites.Cotisations;
import entites.Employes;
import entites.Indemnites;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
 
/**
 *
 * @author Baba
 */
public class JUnitMetier {
 
        // couche métier
        private static IMetier metier;
 
    @BeforeClass
    public static void init() {
        //log("init");
        ApplicationContext ctx =  new ClassPathXmlApplicationContext("spring-metier-dao.xml");
         metier = (IMetier) ctx.getBean("metier");
        //couches Dao 
         IEmployesDao employeDao = (IEmployesDao) ctx.getBean("employeDao");
         IIndemnitesDao indemniteDao = (IIndemnitesDao) ctx.getBean("indemniteDao");
         ICotisationsDao cotisationDao = (ICotisationsDao) ctx.getBean("cotisationDao");
        //clean();
        //fill();
        System.out.println("Salut");
 
        // on vide la base
        for(Employes employe : employeDao.findAll()) {
            employeDao.destroy(employe);
        }
        for(Cotisations cotisation : cotisationDao.findAll()) {
            cotisationDao.destroy(cotisation);
        }
        for(Indemnites indemnite : indemniteDao.findAll()) {
            indemniteDao.destroy(indemnite);
        }
 
        // on remplit la base
        Indemnites indemnite1 = new Indemnites(1,1.93,2,2,12);
        Indemnites indemnite2 = new Indemnites(2,2.1,3,3,15);
        indemnite1 = indemniteDao.create(indemnite1);
        indemnite2 = indemniteDao.create(indemnite2);
        employeDao.create(new Employes("Baba", "Camara", "254104940426058","5 rue Matam","Matam","Conakry",indemnite2));
        employeDao.create(new Employes("Aissata", "Camara", "254104940426060","5 rue Matam","Matam","Conakry",indemnite1));
 
        cotisationDao.create(new Cotisations(3.49,6.15,9.39,7.88));
 
 
    }
 
    public static void log(String message) {
    System.out.println("----------- " + message);
    }
 
 
   // test
    @Test
    public void test01(){
 
    // calcul de feuilles de salaire
        System.out.println(metier.CalculerFeuilleSalaire("254104940426060", 30, 5));
        System.out.println(metier.CalculerFeuilleSalaire("254104940426058", 150, 20));
    } 
}
A l’exécution j'obtiens le message suivant:

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
 
Tests run: 0, Failures: 0, Errors: 1, Time elapsed: 10,218 sec
 
------------- Standard Output ---------------
Salut
------------- ---------------- ---------------
------------- Standard Error -----------------
juil. 04, 2014 11:55:56 AM org.springframework.context.support.AbstractApplicationContext prepareRefresh
Infos: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@277e07ae: display name [org.springframework.context.support.ClassPathXmlApplicationContext@277e07ae]; startup date [Fri Jul 04 11:55:56 UTC 2014]; root of context hierarchy
juil. 04, 2014 11:55:56 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
Infos: Loading XML bean definitions from class path resource [spring-metier-dao.xml]
juil. 04, 2014 11:55:57 AM org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
Infos: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@277e07ae]: org.springframework.beans.factory.support.DefaultListableBeanFactory@44f5df97
juil. 04, 2014 11:55:57 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
Infos: Bean 'dataSource' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
juil. 04, 2014 11:55:57 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
Infos: Bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#41518a15' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
juil. 04, 2014 11:55:57 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
Infos: Bean 'org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver#50408a33' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
juil. 04, 2014 11:55:57 AM org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean createNativeEntityManagerFactory
Infos: Building JPA container EntityManagerFactory for persistence unit 'PamSpringPU'
juil. 04, 2014 11:55:57 AM org.hibernate.cfg.annotations.Version <clinit>
Infos: Hibernate Annotations 3.3.1.GA
juil. 04, 2014 11:55:57 AM org.hibernate.cfg.Environment <clinit>
Infos: Hibernate 3.2.5
juil. 04, 2014 11:55:57 AM org.hibernate.cfg.Environment <clinit>
Infos: hibernate.properties not found
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.Environment buildBytecodeProvider
Infos: Bytecode provider name : cglib
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.Environment <clinit>
Infos: using JDK 1.4 java.sql.Timestamp handling
juil. 04, 2014 11:55:58 AM org.hibernate.ejb.Version <clinit>
Infos: Hibernate EntityManager 3.3.2.GA
juil. 04, 2014 11:55:58 AM org.hibernate.ejb.Ejb3Configuration configure
Infos: Processing PersistenceUnitInfo [
	name: PamSpringPU
	...]
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.AnnotationBinder bindClass
Infos: Binding entity from annotated class: entites.Cotisations
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.annotations.QueryBinder bindQuery
Infos: Binding Named query: Cotisations.findAll => SELECT r FROM Cotisations r
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.annotations.EntityBinder bindTable
Infos: Bind entity entites.Cotisations on table cotisations
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.AnnotationBinder bindClass
Infos: Binding entity from annotated class: entites.Employes
juil. 04, 2014 11:55:58 AM org.hibernate.cfg.annotations.EntityBinder bindTable
Infos: Bind entity entites.Employes on table employes
juil. 04, 2014 11:55:59 AM org.hibernate.cfg.AnnotationBinder bindClass
Infos: Binding entity from annotated class: entites.Indemnites
juil. 04, 2014 11:55:59 AM org.hibernate.cfg.annotations.EntityBinder bindTable
Infos: Bind entity entites.Indemnites on table indemnites
juil. 04, 2014 11:55:59 AM org.hibernate.cfg.annotations.CollectionBinder bindOneToManySecondPass
Infos: Mapping collection: entites.Indemnites.employes -> employes
juil. 04, 2014 11:55:59 AM org.hibernate.cfg.AnnotationConfiguration secondPassCompile
Infos: Hibernate Validator not found: ignoring
juil. 04, 2014 11:55:59 AM org.hibernate.connection.ConnectionProviderFactory newConnectionProvider
Infos: Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
juil. 04, 2014 11:55:59 AM org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider configure
Infos: Using provided datasource
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: RDBMS: MySQL, version: 5.5.20-log
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.18 ( Revision: tonci.grgin@oracle.com-20110930151701-jfj14ddfq48ifkfq )
juil. 04, 2014 11:56:02 AM org.hibernate.dialect.Dialect <init>
Infos: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
juil. 04, 2014 11:56:02 AM org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
Infos: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
juil. 04, 2014 11:56:02 AM org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
Infos: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Automatic flush during beforeCompletion(): disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Automatic session close at end of transaction: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: JDBC batch size: 15
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: JDBC batch updates for versioned data: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Scrollable result sets: enabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: JDBC3 getGeneratedKeys(): enabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Connection release mode: auto
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Maximum outer join fetch depth: 2
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Default batch fetch size: 1
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Generate SQL with comments: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Order SQL updates by primary key: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Order SQL inserts for batching: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
Infos: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
juil. 04, 2014 11:56:02 AM org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
Infos: Using ASTQueryTranslatorFactory
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Query language substitutions: {}
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: JPA-QL strict compliance: enabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Second-level cache: enabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Query cache: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory createCacheProvider
Infos: Cache provider: org.hibernate.cache.NoCacheProvider
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Optimize cache for minimal puts: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Structured second-level cache entries: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Statistics: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Deleted entity synthetic identifier rollback: disabled
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Default entity-mode: pojo
juil. 04, 2014 11:56:02 AM org.hibernate.cfg.SettingsFactory buildSettings
Infos: Named query checking : enabled
juil. 04, 2014 11:56:02 AM org.hibernate.impl.SessionFactoryImpl <init>
Infos: building session factory
juil. 04, 2014 11:56:03 AM org.hibernate.impl.SessionFactoryObjectFactory addInstance
Infos: Not binding factory to JNDI, no JNDI name configured
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
Infos: Running hbm2ddl schema update
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
Infos: fetching database metadata
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
Infos: updating schema
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: table found: dbPam.cotisations
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: columns: [secu, id, csgd, retraite, csgrds, version]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: foreign keys: []
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: indexes: [primary]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: table found: dbPam.employes
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: columns: [prenom, id, cp, adresse, ville, ss, indemnite_id, nom, version]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: foreign keys: [fk4722e6bc3e7ac411, fk_employes_indemnite_id, fk4722e6bc398c5d0]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: indexes: [fk4722e6bc3e7ac411, fk_employes_indemnite_id, primary, ss, fk4722e6bc398c5d0]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: table found: dbPam.indemnites
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: columns: [id, indice, repas_jour, base_heure, indemnites_cp, entretien_jour, version]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: foreign keys: []
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.TableMetadata <init>
Infos: indexes: [indice, primary]
juil. 04, 2014 11:56:03 AM org.hibernate.tool.hbm2ddl.SchemaUpdate execute
Infos: schema update complete
juil. 04, 2014 11:56:04 AM org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
Infos: Bean 'entityManagerFactory' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
juil. 04, 2014 11:56:04 AM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
Infos: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@44f5df97: defining beans [employeDao,indemniteDao,cotisationDao,metier,entityManagerFactory,dataSource,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,txManager,org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0,org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor#0]; root of factory hierarchy
------------- ---------------- ---------------
Testcase: metier.JUnitMetier:	Caused an ERROR
javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: entites.Employes.indemnites
exception.PamException: javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: entites.Employes.indemnites
	at dao.EmployeDao.create(EmployeDao.java:23)
	at metier.JUnitMetier.init(JUnitMetier.java:63)
Caused by: javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: entites.Employes.indemnites
	at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:637)
	at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:226)
	at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
	at com.sun.proxy.$Proxy22.persist(Unknown Source)
	at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:198)
	at com.sun.proxy.$Proxy22.persist(Unknown Source)
	at dao.EmployeDao.create(EmployeDao.java:20)
Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: entites.Employes.indemnites
	at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
	at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:290)
	at org.hibernate.event.def.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:181)
	at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:107)
	at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:49)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:131)
	at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:87)
	at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:38)
	at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:618)
	at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:592)
	at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:596)
	at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:220)
 
 
Test metier.JUnitMetier FAILED
test:
Deleting: C:\Users\Baba\AppData\Local\Temp\TEST-metier.JUnitMetier.xml
BUILD SUCCESSFUL (total time: 18 seconds)