IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

JPA Java Discussion :

probleme en jpa


Sujet :

JPA Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2010
    Messages : 15
    Par défaut probleme en jpa
    bonjour,

    voilà le code de mon entité :

    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
     
    package org.esprit.persistence;
     
    import java.io.Serializable;
    import java.lang.String;
    import java.util.Date;
    import javax.persistence.*;
     
    /**
     * Entity implementation class for Entity: Employee
     *
     */
    @Entity(name="t_employee")
     
    public class Employee implements Serializable {
     
     
    	private String matricule;
    	private String surname;
    	private String name;
    	private String e_mail;
    	private Date date_of_birth;
    	private String login;
    	private String password;
    	private Superior superior;
    	private static final long serialVersionUID = 1L;
     
    	public Employee() {
    		super();
    	}   
    	@Id    @Column(name="pk_employee")
    	public String getMatricule() {
    		return this.matricule;
    	}
     
    	public void setMatricule(String matricule) {
    		this.matricule = matricule;
    	}   
    	public String getSurname() {
    		return this.surname;
    	}
     
    	public void setSurname(String surname) {
    		this.surname = surname;
    	}   
    	public String getName() {
    		return this.name;
    	}
     
    	public void setName(String name) {
    		this.name = name;
    	}   
    	public String getE_mail() {
    		return this.e_mail;
    	}
     
    	public void setE_mail(String e_mail) {
    		this.e_mail = e_mail;
    	}   
     
    	@Temporal(TemporalType.DATE)
    	public Date getDate_of_birth() {
    		return this.date_of_birth;
    	}
     
    	public void setDate_of_birth(Date date_of_birth) {
    		this.date_of_birth = date_of_birth;
    	}   
    	public String getLogin() {
    		return this.login;
    	}
     
    	public void setLogin(String login) {
    		this.login = login;
    	}   
    	public String getPassword() {
    		return this.password;
    	}
     
    	public void setPassword(String password) {
    		this.password = password;
    	}
    	public void setSuperior(Superior superior) {
    		this.superior = superior;
    	}
     
    //unidirectional many to one 
    	@ManyToOne @JoinColumn(name="superior_id",referencedColumnName="pk_superior")
    	public Superior getSuperior() {
    		return superior;
    	}
     
    }


    ensuite j'ai fait une classe DAO pour les opération CRUD

    et voilà ma classe de test :

    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
     
    package org.esprit.tests;
     
    import java.util.Date;
     
    import javax.persistence.EntityTransaction;
     
    import org.esprit.DAOs.EmployeeDAO;
    import org.esprit.DAOs.SuperiorDAO;
    import org.esprit.persistence.Employee;
    import org.esprit.persistence.Superior;
    import org.esprit.utilities.JPAUtil;
     
    public class AddEmployeeDAO {
     
     
    	public static void main(String[] args) {
     
     
    	    Superior superior=new Superior();
    	    SuperiorDAO supdao= SuperiorDAO.getInstance();
    	    superior = supdao.getSuperiorByReference("5265d");
     
    		Employee employee= new Employee();
    		employee.setSurname("yness");
    		employee.setName("barboura");
    		employee.setMatricule("025l");
    		employee.setLogin("ynessb");
    		employee.setPassword("yness");
    		employee.setDate_of_birth(new Date("23/02/1987"));
    		employee.setE_mail("yness_91@hotmail.com");
    		employee.setSuperior(superior);
     
     
    		EmployeeDAO employeedao= EmployeeDAO.getInstance();
    		EntityTransaction tx= JPAUtil.getEm("punit1").getTransaction();
    		try{
    			tx.begin();
     
    			employeedao.ajouter(employee);		
    			tx.commit();
    			}catch (Exception e) {
    				tx.rollback();
    				// TODO: handle exception
    			}
     
    	}
     
    }
    quand j'execute, rien ne s'ajoute à ma base et je reçoit le message suivant dans la console

    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
    [TopLink Config]: 2011.03.30 06:13:40.267--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Topic] is being defaulted to: T_TOPIC.
    [TopLink Config]: 2011.03.30 06:13:40.316--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Topic.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.318--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Manager] is being defaulted to: T_MANAGER.
    [TopLink Config]: 2011.03.30 06:13:40.319--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Manager.getSurname()] is being defaulted to: SURNAME.
    [TopLink Config]: 2011.03.30 06:13:40.320--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Manager.getE_mail()] is being defaulted to: E_MAIL.
    [TopLink Config]: 2011.03.30 06:13:40.322--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.util.Date org.esprit.persistence.Manager.getDate_of_birth()] is being defaulted to: DATE_OF_BIRTH.
    [TopLink Config]: 2011.03.30 06:13:40.324--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Manager.getLogin()] is being defaulted to: LOGIN.
    [TopLink Config]: 2011.03.30 06:13:40.325--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Manager.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.325--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Manager.getPassword()] is being defaulted to: PASSWORD.
    [TopLink Config]: 2011.03.30 06:13:40.325--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Employee] is being defaulted to: T_EMPLOYEE.
    [TopLink Config]: 2011.03.30 06:13:40.326--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Employee.getSurname()] is being defaulted to: SURNAME.
    [TopLink Config]: 2011.03.30 06:13:40.327--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Employee.getE_mail()] is being defaulted to: E_MAIL.
    [TopLink Config]: 2011.03.30 06:13:40.327--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.util.Date org.esprit.persistence.Employee.getDate_of_birth()] is being defaulted to: DATE_OF_BIRTH.
    [TopLink Config]: 2011.03.30 06:13:40.328--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Employee.getLogin()] is being defaulted to: LOGIN.
    [TopLink Config]: 2011.03.30 06:13:40.340--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Employee.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.340--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Employee.getPassword()] is being defaulted to: PASSWORD.
    [TopLink Config]: 2011.03.30 06:13:40.341--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Catalog] is being defaulted to: T_CATALOG.
    [TopLink Config]: 2011.03.30 06:13:40.347--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Catalog.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.348--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Session] is being defaulted to: T_SESSION.
    [TopLink Config]: 2011.03.30 06:13:40.348--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Session.getDuration()] is being defaulted to: DURATION.
    [TopLink Config]: 2011.03.30 06:13:40.349--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Session.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.350--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.util.Date org.esprit.persistence.Session.getDate()] is being defaulted to: DATE.
    [TopLink Config]: 2011.03.30 06:13:40.350--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Training] is being defaulted to: T_TRAINING.
    [TopLink Config]: 2011.03.30 06:13:40.362--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public int org.esprit.persistence.Training.getCapacity()] is being defaulted to: CAPACITY.
    [TopLink Config]: 2011.03.30 06:13:40.363--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Training.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.364--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Superior] is being defaulted to: T_SUPERIOR.
    [TopLink Config]: 2011.03.30 06:13:40.364--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Superior.getSurname()] is being defaulted to: SURNAME.
    [TopLink Config]: 2011.03.30 06:13:40.365--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Superior.getE_mail()] is being defaulted to: E_MAIL.
    [TopLink Config]: 2011.03.30 06:13:40.365--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.util.Date org.esprit.persistence.Superior.getDate_of_birth()] is being defaulted to: DATE_OF_BIRTH.
    [TopLink Config]: 2011.03.30 06:13:40.365--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Superior.getLogin()] is being defaulted to: LOGIN.
    [TopLink Config]: 2011.03.30 06:13:40.366--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Superior.getName()] is being defaulted to: NAME.
    [TopLink Config]: 2011.03.30 06:13:40.366--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public java.lang.String org.esprit.persistence.Superior.getPassword()] is being defaulted to: PASSWORD.
    [TopLink Config]: 2011.03.30 06:13:40.366--ServerSession(6616781)--Thread(Thread[main,5,main])--The table name for entity [class org.esprit.persistence.Request] is being defaulted to: T_REQUEST.
    [TopLink Config]: 2011.03.30 06:13:40.369--ServerSession(6616781)--Thread(Thread[main,5,main])--The column name for element [public boolean org.esprit.persistence.Request.isDecision()] is being defaulted to: DECISION.
    [TopLink Config]: 2011.03.30 06:13:40.372--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [public org.esprit.persistence.Superior org.esprit.persistence.Employee.getSuperior()] is being defaulted to: class org.esprit.persistence.Superior.
    [TopLink Config]: 2011.03.30 06:13:40.430--ServerSession(6616781)--Thread(Thread[main,5,main])--The primary key column name for the mapping element [public org.esprit.persistence.Superior org.esprit.persistence.Employee.getSuperior()] is being defaulted to: pk_superior.
    [TopLink Config]: 2011.03.30 06:13:40.430--ServerSession(6616781)--Thread(Thread[main,5,main])--The foreign key column name for the mapping element [public org.esprit.persistence.Superior org.esprit.persistence.Employee.getSuperior()] is being defaulted to: SUPERIOR_pk_superior.
    [TopLink Config]: 2011.03.30 06:13:40.431--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [public org.esprit.persistence.Training org.esprit.persistence.Session.getTraining()] is being defaulted to: class org.esprit.persistence.Training.
    [TopLink Config]: 2011.03.30 06:13:40.432--ServerSession(6616781)--Thread(Thread[main,5,main])--The primary key column name for the mapping element [public org.esprit.persistence.Training org.esprit.persistence.Session.getTraining()] is being defaulted to: pk_training.
    [TopLink Config]: 2011.03.30 06:13:40.435--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [public org.esprit.persistence.Training org.esprit.persistence.Request.getTraining()] is being defaulted to: class org.esprit.persistence.Training.
    [TopLink Config]: 2011.03.30 06:13:40.435--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [public org.esprit.persistence.Employee org.esprit.persistence.Request.getEmployee()] is being defaulted to: class org.esprit.persistence.Employee.
    [TopLink Config]: 2011.03.30 06:13:40.435--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the many to one mapping element [public org.esprit.persistence.Topic org.esprit.persistence.Training.getTopic()] is being defaulted to: class org.esprit.persistence.Topic.
    [TopLink Config]: 2011.03.30 06:13:40.436--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to many mapping element [public java.util.List org.esprit.persistence.Training.getSessions()] is being defaulted to: class org.esprit.persistence.Session.
    [TopLink Config]: 2011.03.30 06:13:40.465--ServerSession(6616781)--Thread(Thread[main,5,main])--The target entity (reference) class for the one to one mapping element [public org.esprit.persistence.Topic org.esprit.persistence.Catalog.getTopic()] is being defaulted to: class org.esprit.persistence.Topic.
    [TopLink Info]: 2011.03.30 06:13:40.904--ServerSession(6616781)--Thread(Thread[main,5,main])--TopLink, version: Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))
    [TopLink Config]: 2011.03.30 06:13:40.912--ServerSession(6616781)--Connection(10059989)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.054--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Config]: 2011.03.30 06:13:41.054--ServerSession(6616781)--Connection(7461949)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.068--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Config]: 2011.03.30 06:13:41.068--ServerSession(6616781)--Connection(3969559)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.080--ServerSession(6616781)--Connection(13121485)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Config]: 2011.03.30 06:13:41.080--ServerSession(6616781)--Connection(13080585)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.088--ServerSession(6616781)--Connection(4047035)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Config]: 2011.03.30 06:13:41.089--ServerSession(6616781)--Connection(3686501)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.101--ServerSession(6616781)--Connection(23860799)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Config]: 2011.03.30 06:13:41.101--ServerSession(6616781)--Connection(19432672)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.119--ServerSession(6616781)--Connection(14372770)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Config]: 2011.03.30 06:13:41.119--ServerSession(6616781)--Connection(4791372)--Thread(Thread[main,5,main])--connecting(DatabaseLogin(
    	platform=>MySQL4Platform
    	user name=> "jpauser"
    	datasource URL=> "jdbc:mysql://localhost:3306/jpa"
    ))
    [TopLink Config]: 2011.03.30 06:13:41.128--ServerSession(6616781)--Connection(3338151)--Thread(Thread[main,5,main])--Connected: jdbc:mysql://localhost:3306/jpa
    	User: jpauser@localhost
    	Database: MySQL  Version: 5.0.27-community-nt
    	Driver: MySQL-AB JDBC Driver  Version: mysql-connector-java-5.0.4 ( $Date: 2006-10-19 17:47:48 +0200 (Thu, 19 Oct 2006) $, $Revision: 5908 $ )
    [TopLink Info]: 2011.03.30 06:13:41.230--ServerSession(6616781)--Thread(Thread[main,5,main])--file:/E:/workspacePFA/PersistenceProject/build/classes/-punit1 login successful
    [TopLink Fine]: 2011.03.30 06:13:41.247--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--CREATE TABLE T_MANAGER (pk_manager VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE, LOGIN VARCHAR(255), E_MAIL VARCHAR(255), NAME VARCHAR(255), SURNAME VARCHAR(255), PASSWORD VARCHAR(255), PRIMARY KEY (pk_manager))
    [TopLink Warning]: 2011.03.30 06:13:41.265--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_manager' already exists
    Error Code: 1050
    Call: CREATE TABLE T_MANAGER (pk_manager VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE, LOGIN VARCHAR(255), E_MAIL VARCHAR(255), NAME VARCHAR(255), SURNAME VARCHAR(255), PASSWORD VARCHAR(255), PRIMARY KEY (pk_manager))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.268--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--CREATE TABLE T_CATALOG (pk_catalog INTEGER AUTO_INCREMENT NOT NULL, NAME VARCHAR(255), id_topic INTEGER, PRIMARY KEY (pk_catalog))
    [TopLink Warning]: 2011.03.30 06:13:41.269--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_catalog' already exists
    Error Code: 1050
    Call: CREATE TABLE T_CATALOG (pk_catalog INTEGER AUTO_INCREMENT NOT NULL, NAME VARCHAR(255), id_topic INTEGER, PRIMARY KEY (pk_catalog))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.271--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--CREATE TABLE T_REQUEST (pk_request INTEGER AUTO_INCREMENT NOT NULL, DECISION TINYINT(1) default 0, training_id INTEGER, employee_id VARCHAR(255), PRIMARY KEY (pk_request))
    [TopLink Warning]: 2011.03.30 06:13:41.271--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_request' already exists
    Error Code: 1050
    Call: CREATE TABLE T_REQUEST (pk_request INTEGER AUTO_INCREMENT NOT NULL, DECISION TINYINT(1) default 0, training_id INTEGER, employee_id VARCHAR(255), PRIMARY KEY (pk_request))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.272--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--CREATE TABLE T_EMPLOYEE (pk_employee VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE, LOGIN VARCHAR(255), SURNAME VARCHAR(255), NAME VARCHAR(255), PASSWORD VARCHAR(255), E_MAIL VARCHAR(255), SUPERIOR_pk_superior VARCHAR(255), PRIMARY KEY (pk_employee))
    [TopLink Warning]: 2011.03.30 06:13:41.272--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_employee' already exists
    Error Code: 1050
    Call: CREATE TABLE T_EMPLOYEE (pk_employee VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE, LOGIN VARCHAR(255), SURNAME VARCHAR(255), NAME VARCHAR(255), PASSWORD VARCHAR(255), E_MAIL VARCHAR(255), SUPERIOR_pk_superior VARCHAR(255), PRIMARY KEY (pk_employee))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.273--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--CREATE TABLE T_SESSION (pk_session INTEGER AUTO_INCREMENT NOT NULL, DURATION VARCHAR(255), DATE DATE, NAME VARCHAR(255), training_id INTEGER, PRIMARY KEY (pk_session))
    [TopLink Warning]: 2011.03.30 06:13:41.273--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_session' already exists
    Error Code: 1050
    Call: CREATE TABLE T_SESSION (pk_session INTEGER AUTO_INCREMENT NOT NULL, DURATION VARCHAR(255), DATE DATE, NAME VARCHAR(255), training_id INTEGER, PRIMARY KEY (pk_session))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.274--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--CREATE TABLE T_TRAINING (pk_training INTEGER AUTO_INCREMENT NOT NULL, CAPACITY INTEGER, NAME VARCHAR(255), topic_id INTEGER, PRIMARY KEY (pk_training))
    [TopLink Warning]: 2011.03.30 06:13:41.274--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_training' already exists
    Error Code: 1050
    Call: CREATE TABLE T_TRAINING (pk_training INTEGER AUTO_INCREMENT NOT NULL, CAPACITY INTEGER, NAME VARCHAR(255), topic_id INTEGER, PRIMARY KEY (pk_training))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.274--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--CREATE TABLE T_SUPERIOR (pk_superior VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE, LOGIN VARCHAR(255), E_MAIL VARCHAR(255), NAME VARCHAR(255), SURNAME VARCHAR(255), PASSWORD VARCHAR(255), PRIMARY KEY (pk_superior))
    [TopLink Warning]: 2011.03.30 06:13:41.275--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_superior' already exists
    Error Code: 1050
    Call: CREATE TABLE T_SUPERIOR (pk_superior VARCHAR(255) NOT NULL, DATE_OF_BIRTH DATE, LOGIN VARCHAR(255), E_MAIL VARCHAR(255), NAME VARCHAR(255), SURNAME VARCHAR(255), PASSWORD VARCHAR(255), PRIMARY KEY (pk_superior))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.275--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--CREATE TABLE T_TOPIC (pk_topic INTEGER AUTO_INCREMENT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (pk_topic))
    [TopLink Warning]: 2011.03.30 06:13:41.276--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table 't_topic' already exists
    Error Code: 1050
    Call: CREATE TABLE T_TOPIC (pk_topic INTEGER AUTO_INCREMENT NOT NULL, NAME VARCHAR(255), PRIMARY KEY (pk_topic))
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.276--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--ALTER TABLE T_CATALOG ADD CONSTRAINT FK_T_CATALOG_id_topic FOREIGN KEY (id_topic) REFERENCES T_TOPIC (pk_topic)
    [TopLink Warning]: 2011.03.30 06:13:41.421--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Can't create table '.\jpa\#sql-2f4_9c.frm' (errno: 121)
    Error Code: 1005
    Call: ALTER TABLE T_CATALOG ADD CONSTRAINT FK_T_CATALOG_id_topic FOREIGN KEY (id_topic) REFERENCES T_TOPIC (pk_topic)
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.422--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--ALTER TABLE T_REQUEST ADD CONSTRAINT FK_T_REQUEST_employee_id FOREIGN KEY (employee_id) REFERENCES T_EMPLOYEE (pk_employee)
    [TopLink Warning]: 2011.03.30 06:13:41.510--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Can't create table '.\jpa\#sql-2f4_9b.frm' (errno: 121)
    Error Code: 1005
    Call: ALTER TABLE T_REQUEST ADD CONSTRAINT FK_T_REQUEST_employee_id FOREIGN KEY (employee_id) REFERENCES T_EMPLOYEE (pk_employee)
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.511--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--ALTER TABLE T_EMPLOYEE ADD CONSTRAINT FK_T_EMPLOYEE_SUPERIOR_pk_superior FOREIGN KEY (SUPERIOR_pk_superior) REFERENCES T_SUPERIOR (pk_superior)
    [TopLink Warning]: 2011.03.30 06:13:41.511--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Key column 'SUPERIOR_pk_superior' doesn't exist in table
    Error Code: 1072
    Call: ALTER TABLE T_EMPLOYEE ADD CONSTRAINT FK_T_EMPLOYEE_SUPERIOR_pk_superior FOREIGN KEY (SUPERIOR_pk_superior) REFERENCES T_SUPERIOR (pk_superior)
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.512--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--ALTER TABLE T_SESSION ADD CONSTRAINT FK_T_SESSION_training_id FOREIGN KEY (training_id) REFERENCES T_TRAINING (pk_training)
    [TopLink Warning]: 2011.03.30 06:13:41.599--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Can't create table '.\jpa\#sql-2f4_9b.frm' (errno: 121)
    Error Code: 1005
    Call: ALTER TABLE T_SESSION ADD CONSTRAINT FK_T_SESSION_training_id FOREIGN KEY (training_id) REFERENCES T_TRAINING (pk_training)
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.600--ServerSession(6616781)--Connection(22316618)--Thread(Thread[main,5,main])--ALTER TABLE T_TRAINING ADD CONSTRAINT FK_T_TRAINING_topic_id FOREIGN KEY (topic_id) REFERENCES T_TOPIC (pk_topic)
    [TopLink Warning]: 2011.03.30 06:13:41.666--ServerSession(6616781)--Thread(Thread[main,5,main])--Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLException: Can't create table '.\jpa\#sql-2f4_9c.frm' (errno: 121)
    Error Code: 1005
    Call: ALTER TABLE T_TRAINING ADD CONSTRAINT FK_T_TRAINING_topic_id FOREIGN KEY (topic_id) REFERENCES T_TOPIC (pk_topic)
    Query: DataModifyQuery()
    [TopLink Fine]: 2011.03.30 06:13:41.719--ServerSession(6616781)--Connection(7896426)--Thread(Thread[main,5,main])--SELECT pk_superior, DATE_OF_BIRTH, LOGIN, E_MAIL, NAME, SURNAME, PASSWORD FROM T_SUPERIOR WHERE (pk_superior = ?)
    	bind => [0587]
    je ne comprend pas pourquoi aucune ligne ne s'ajoute à ma table !
    est ce causé par l'attribut Superior au niveau de la classe Employee ? puisqu'il est de type object... Sinon quelqu'un a t-il une idée sur comment résoudre ce problème ?

  2. #2
    Membre averti
    Femme Profil pro
    Étudiant
    Inscrit en
    Février 2010
    Messages
    15
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2010
    Messages : 15
    Par défaut
    Le problème été du à l'annotation @manytoone @joincolumn(name="superior_id", referencedcolumnname="pk_superior"), plus exactement à "referencedColumnName"...quand je l'ai supprimé tout marche !

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. probleme avec JPA
    Par execrable dans le forum JPA
    Réponses: 1
    Dernier message: 28/04/2011, 12h18
  2. [Data] Problem injection JPA Spring EntityManagerFactory
    Par promachos dans le forum Spring
    Réponses: 6
    Dernier message: 21/09/2010, 13h33
  3. probleme avec JPA
    Par riadhhwajdii dans le forum JPA
    Réponses: 0
    Dernier message: 29/10/2009, 09h46
  4. Probleme Hibernate + JPA -> lazy loading non respecté
    Par MikoMax dans le forum Hibernate
    Réponses: 1
    Dernier message: 28/08/2007, 15h13
  5. Réponses: 2
    Dernier message: 25/04/2007, 13h03

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo