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

Hibernate Java Discussion :

syntaxe sur requete


Sujet :

Hibernate Java

  1. #1
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut syntaxe sur requete
    Bonjour,

    je débute avec Hibernate, et je rencontre un problème à l'execution de mon projet.

    Mon fichier Test.java dans le package par défaut 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
     
    import java.util.*;
    import net.sf.hibernate.*;
    import com.hibernate.*;
     
    public class Test {
     
     public static void main(String[] args)	throws HibernateException {
    	 Session session = HibernateUtil.currentSession();;
    	 //Transaction tx = session.beginTransaction();
    	 //Query requette = session.createQuery("FROM Fwexemple");
    	 //List list = requette.list();
    	 Iterator list = session.createSQLQuery("select *  FROM Fwexemple","Fwexemple",Fwexemple.class).list().listIterator();
    	 while(list.hasNext())
    	 {
    		 Fwexemple user = (Fwexemple)list.next();
    	   System.out.println(user.toString());
    	 }
     
    	 HibernateUtil.closeSession();
     
     }
    }
    Ensuite le fichier Fwexemple.java contient :

    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
     
    package com.hibernate;
     
    import java.io.Serializable;
    import net.sf.hibernate.PersistentEnum;
     
    /**
     * This class has been automatically generated by Hibernate Synchronizer.
     * For more information or documentation, visit The Hibernate Synchronizer page
     * at http://www.binamics.com/hibernatesync or contact Joe Hudson at joe@binamics.com.
     */
    @SuppressWarnings("deprecation")
    public class Fwexemple implements Serializable, PersistentEnum {
     
    	/**
             * 
             */
    	private static final long serialVersionUID = 6137497370677628315L;
    	public static final Fwexemple WEB_USER = new Fwexemple(69);
    	public static final Fwexemple PROFIL_C_O_M = new Fwexemple(64);
    	public static final Fwexemple EQUIPE_DÉVELOPPEMENT = new Fwexemple(65);
    	public static final Fwexemple DEMO_USER = new Fwexemple(200);
    	public static final Fwexemple PROFIL_D_E_V1 = new Fwexemple(66);
    	public static final Fwexemple PROFIL_G_R_O_U_P_E = new Fwexemple(67);
    	public static final Fwexemple GESTIONNAIRE_T_H_E_M_6 = new Fwexemple(128);
    	public static final Fwexemple DIMITRI = new Fwexemple(950);
    	public static final Fwexemple USER_INTRANET = new Fwexemple(400);
    	public static final Fwexemple PROFIL_P_R_O_F_I_L = new Fwexemple(79);
    	public static final Fwexemple ANGLAIS = new Fwexemple(21);
    	public static final Fwexemple GUILLAUME = new Fwexemple(90);
    	public static final Fwexemple CYRIL = new Fwexemple(34);
    	public static final Fwexemple VEGA_MESSAGERIE_GROUPE = new Fwexemple(102);
    	public static final Fwexemple ALINE = new Fwexemple(103);
    	public static final Fwexemple UTILISATEUR_P_D_A = new Fwexemple(652);
    	public static final Fwexemple AKIM = new Fwexemple(109);
    	public static final Fwexemple ROBOT = new Fwexemple(106);
    	public static final Fwexemple SERVICE_DÉVELOPPEMENT = new Fwexemple(47);
    	public static final Fwexemple FZEFZ = new Fwexemple(50);
    	public static final Fwexemple CHRISTOPHE = new Fwexemple(909);
    	public static final Fwexemple ADMINISTRATEUR_SYSTEME = new Fwexemple(49);
    	public static final Fwexemple DANIEL = new Fwexemple(908);
    	public static final Fwexemple MAINTENANCE_ATELIER = new Fwexemple(48);
    	public static final Fwexemple RENAUD = new Fwexemple(907);
    	public static final Fwexemple SÉBASTIEN = new Fwexemple(906);
    	public static final Fwexemple OLIVIER = new Fwexemple(904);
    	public static final Fwexemple SERVICE_COMMERCIAL = new Fwexemple(126);
    	public static final Fwexemple JEAN_PIERRE = new Fwexemple(902);
    	public static final Fwexemple BERNARD = new Fwexemple(901);
     
    	private final int code;
     
    	protected Fwexemple(int code) {
    		this.code = code;
    	}
     
    	public int toInt() { return code; }
     
    	public static Fwexemple fromInt(int code) {
    		switch (code) {
    			case 69: return WEB_USER;
    			case 64: return PROFIL_C_O_M;
    			case 65: return EQUIPE_DÉVELOPPEMENT;
    			case 200: return DEMO_USER;
    			case 66: return PROFIL_D_E_V1;
    			case 67: return PROFIL_G_R_O_U_P_E;
    			case 128: return GESTIONNAIRE_T_H_E_M_6;
    			case 950: return DIMITRI;
    			case 400: return USER_INTRANET;
    			case 79: return PROFIL_P_R_O_F_I_L;
    			case 21: return ANGLAIS;
    			case 90: return GUILLAUME;
    			case 34: return CYRIL;
    			case 102: return MESSAGERIE_GROUPE;
    			case 103: return ALINE;
    			case 652: return UTILISATEUR_P_D_A;
    			case 109: return AKIM;
    			case 106: return ROBOT;
    			case 47: return SERVICE_DÉVELOPPEMENT;
    			case 50: return FZEFZ;
    			case 909: return CHRISTOPHE;
    			case 49: return ADMINISTRATEUR_SYSTEME;
    			case 908: return DANIEL;
    			case 48: return MAINTENANCE_ATELIER;
    			case 907: return RENAUD;
    			case 906: return SÉBASTIEN;
    			case 904: return OLIVIER;
    			case 126: return SERVICE_COMMERCIAL;
    			case 902: return JEAN_PIERRE;
    			case 901: return BERNARD;
    			default: throw new RuntimeException("Unknown value: " + code);
    		}
    	}
     
    	public String toString () {
    		switch (code) {
    			case 69: return "Web User";
    			case 64: return "Profil : COM";
    			case 65: return "Equipe développement";
    			case 200: return "DEMO USER";
    			case 66: return "Profil : DEV1";
    			case 67: return "Profil : GROUPE";
    			case 128: return "Gestionnaire THEM 6";
    			case 950: return "Dimitri";
    			case 400: return "User intranet";
    			case 79: return "Profil : PROFIL";
    			case 21: return "ANGLAIS";
    			case 90: return "Guillaume";
    			case 34: return "Cyril";
    			case 102: return "MESSAGERIE GROUPE";
    			case 103: return "Aline";
    			case 652: return "Utilisateur PDA";
    			case 109: return "Akim";
    			case 106: return "Robot";
    			case 47: return "Service développement";
    			case 50: return "COMPTOIRfzefz";
    			case 909: return "Christophe";
    			case 49: return "Administrateur Systeme";
    			case 908: return "Daniel";
    			case 48: return "MAINTENANCE, ATELIER";
    			case 907: return "Renaud";
    			case 906: return "Sébastien";
    			case 904: return "Olivier";
    			case 126: return "Service commercial";
    			case 902: return "Jean-Pierre";
    			case 901: return "Bernard";
    			default: return "Unknown value";
    		}
    	}
    }
    et mon erreur généré 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
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
     
    30 sept. 2010 09:56:34 net.sf.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 2.1.6
    30 sept. 2010 09:56:34 net.sf.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    30 sept. 2010 09:56:34 net.sf.hibernate.cfg.Environment <clinit>
    INFO: using CGLIB reflection optimizer
    30 sept. 2010 09:56:34 net.sf.hibernate.cfg.Configuration configure
    INFO: configuring from resource: /hibernate.cfg.xml
    30 sept. 2010 09:56:34 net.sf.hibernate.cfg.Configuration getConfigurationInputStream
    INFO: Configuration resource: /hibernate.cfg.xml
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.Configuration doConfigure
    INFO: Configured SessionFactory: null
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing one-to-many association mappings
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing one-to-one association property references
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing foreign key constraints
    30 sept. 2010 09:56:36 net.sf.hibernate.dialect.Dialect <init>
    INFO: Using dialect: net.sf.hibernate.dialect.SQLServerDialect
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Use outer join fetching: true
    30 sept. 2010 09:56:36 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: Using Hibernate built-in connection pool (not for production use!)
    30 sept. 2010 09:56:36 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: Hibernate connection pool size: 20
    30 sept. 2010 09:56:36 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: using driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://localhost:1433;DatabaseName=Alocpro;
    30 sept. 2010 09:56:36 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: connection properties: {user=sa, password=gcsi}
    30 sept. 2010 09:56:36 net.sf.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    INFO: Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
    30 sept. 2010 09:56:36 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Use scrollable result sets: true
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Use JDBC3 getGeneratedKeys(): true
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Optimize cache for minimal puts: false
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query language substitutions: {}
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
    30 sept. 2010 09:56:36 net.sf.hibernate.cfg.Configuration configureCaches
    INFO: instantiating and configuring caches
    30 sept. 2010 09:56:36 net.sf.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    30 sept. 2010 09:56:36 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    Exception in thread "main" net.sf.hibernate.MappingException: No persister for: com.hibernate.Fwexemple
    	at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
    	at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
    	at net.sf.hibernate.impl.SessionImpl.getSQLLoadable(SessionImpl.java:3817)
    	at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3796)
    	at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
    	at Test.main(Test.java:12)

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    tu n'a pas mappé la classe FWExemple, que tu utilise dans ta query, dans ton fichier de mapping hibernate.

  3. #3
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    Merci pour la rapidité de votre réponse...Vu que je ne maîtrise pas trop, j'ai essayé de comprendre..et j'ai donc renommer mon fichier Fwexemple.java en F000usr.java...et mon fichier de mapping 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
    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
     
     
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
    	"-//Hibernate/Hibernate Mapping DTD//EN"
    	"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
     
    <hibernate-mapping package="com.hibernate">
    	<class name="F000usr" table="F000USR">
    		<id
    			column="F000KY"
    			name="F000ky"
    			type="integer"
    		>
    			<generator class="vm" />
    		</id>
    		<property
    			column="F000SRVSMTP"
    			length="250"
    			name="F000srvsmtp"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000LIB"
    			length="60"
    			name="F000lib"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000EMAILPWD"
    			length="250"
    			name="F000emailpwd"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000MULTIAFF"
    			length="1"
    			name="F000multiaff"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000INTRANET"
    			length="1"
    			name="F000intranet"
    			not-null="true"
    			type="string"
    		 />
    		<property
    			column="T000LANGUE"
    			length="20"
    			name="T000langue"
    			not-null="true"
    			type="string"
    		 />
    		<property
    			column="F000DIVERS"
    			length="255"
    			name="F000divers"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000EMAIL"
    			length="250"
    			name="F000email"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000GRP"
    			length="1"
    			name="F000grp"
    			not-null="true"
    			type="string"
    		 />
    		<property
    			column="F000SRVPOP3"
    			length="250"
    			name="F000srvpop3"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000MOTPAS"
    			length="100"
    			name="F000motpas"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000NOMUSR"
    			length="20"
    			name="F000nomusr"
    			not-null="true"
    			type="string"
    		 />
    		<property
    			column="F000MAILLOG"
    			length="250"
    			name="F000maillog"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000NIV"
    			length="1"
    			name="F000niv"
    			not-null="true"
    			type="string"
    		 />
    		<property
    			column="F000USRACT"
    			length="40"
    			name="F000usract"
    			not-null="false"
    			type="string"
    		 />
    		<property
    			column="F000TYPEP"
    			length="20"
    			name="F000typep"
    			not-null="true"
    			type="string"
    		 />
    		<property
    			column="F000ACTIF"
    			length="1"
    			name="F000actif"
    			not-null="false"
    			type="string"
    		 />
     
    		<many-to-one
    			class="F050tiers"
    			name="K000050tie"
    			not-null="true"
    		>
    			<column name="K000050TIE" />
    		</many-to-one>
    		<many-to-one
    			class="F004menu"
    			name="K000004menu"
    			not-null="true"
    		>
    			<column name="K000004MENU" />
    		</many-to-one>
    		<many-to-one
    			class="Ftd5prof"
    			name="K000td5prof"
    			not-null="true"
    		>
    			<column name="K000TD5PROF" />
    		</many-to-one>
    		<many-to-one
    			class="F903conn"
    			name="L000903con"
    			not-null="true"
    		>
    			<column name="L000903CON" />
    		</many-to-one>
    		<many-to-one
    			class="Ftc1groupe"
    			name="K000tc1nat"
    			not-null="true"
    		>
    			<column name="K000TC1NAT" />
    		</many-to-one>
    		<many-to-one
    			class="F030age"
    			name="K000030age"
    			not-null="true"
    		>
    			<column name="K000030AGE" />
    		</many-to-one>
    		<many-to-one
    			class="F033sect"
    			name="K000033sect"
    			not-null="true"
    		>
    			<column name="K000033SECT" />
    		</many-to-one>
    		<many-to-one
    			class="F004menu"
    			name="K000004web"
    			not-null="true"
    		>
    			<column name="K000004WEB" />
    		</many-to-one>
    		<set inverse="true" name="F91ZMEMOSetByK91z000usr2">
    			<key column="K91Z000USR2" />
    			<one-to-many class="F91zmemo" />
    		</set>
    		<set inverse="true" name="F00ZGROUPESetByK00z000grp">
    			<key column="K00Z000GRP" />
    			<one-to-many class="F00zgroupe" />
    		</set>
    		<set inverse="true" name="F06TINFFRSSet">
    			<key column="K06T000USR" />
    			<one-to-many class="F06tinffrs" />
    		</set>
    		<set inverse="true" name="F575ETATSet">
    			<key column="K575000USR2" />
    			<one-to-many class="F575etat" />
    		</set>
    		<set inverse="true" name="F570MVTSet">
    			<key column="K570000USR" />
    			<one-to-many class="F570MVT" />
    		</set>
    		<set inverse="true" name="F91ZMEMOSetByK91z000usr">
    			<key column="K91Z000USR" />
    			<one-to-many class="F91zmemo" />
    		</set>
    		<set inverse="true" name="F410LIGSetByK410000equ">
    			<key column="K410000EQU" />
    			<one-to-many class="F410lig" />
    		</set>
    		<set inverse="true" name="F940ACTISetByK940000dest">
    			<key column="K940000DEST" />
    			<one-to-many class="F940acti" />
    		</set>
    		<set inverse="true" name="F990ARCHIVESet">
    			<key column="K990000USR" />
    			<one-to-many class="F990archive" />
    		</set>
    		<set inverse="true" name="F11VTARIFSet">
    			<key column="K11V000USR" />
    			<one-to-many class="F11vtarif" />
    		</set>
    		<set inverse="true" name="F410LIGSetByK410000usr2">
    			<key column="K410000USR2" />
    			<one-to-many class="F410lig" />
    		</set>
    		<set inverse="true" name="F00ZGROUPESetByK00z000usr">
    			<key column="K00Z000USR" />
    			<one-to-many class="F00zgroupe" />
    		</set>
    		<set inverse="true" name="F940ACTISetByK940000emet">
    			<key column="K940000EMET" />
    			<one-to-many class="F940acti" />
    		</set>
    	</class>
    </hibernate-mapping>
    Et maintenant j'obtiens le même message sauf qu'il s'agit de "com.hibernate.F000usr"

    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
     
     
    30 sept. 2010 11:10:19 net.sf.hibernate.cfg.Environment <clinit>
    INFO: Hibernate 2.1.6
    30 sept. 2010 11:10:19 net.sf.hibernate.cfg.Environment <clinit>
    INFO: hibernate.properties not found
    30 sept. 2010 11:10:19 net.sf.hibernate.cfg.Environment <clinit>
    INFO: using CGLIB reflection optimizer
    30 sept. 2010 11:10:19 net.sf.hibernate.cfg.Configuration configure
    INFO: configuring from resource: /hibernate.cfg.xml
    30 sept. 2010 11:10:19 net.sf.hibernate.cfg.Configuration getConfigurationInputStream
    INFO: Configuration resource: /hibernate.cfg.xml
    30 sept. 2010 11:10:20 net.sf.hibernate.cfg.Configuration doConfigure
    INFO: Configured SessionFactory: null
    30 sept. 2010 11:10:20 net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing one-to-many association mappings
    30 sept. 2010 11:10:20 net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing one-to-one association property references
    30 sept. 2010 11:10:20 net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing foreign key constraints
    30 sept. 2010 11:10:20 net.sf.hibernate.dialect.Dialect <init>
    INFO: Using dialect: net.sf.hibernate.dialect.SQLServerDialect
    30 sept. 2010 11:10:20 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Use outer join fetching: true
    30 sept. 2010 11:10:20 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: Using Hibernate built-in connection pool (not for production use!)
    30 sept. 2010 11:10:20 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: Hibernate connection pool size: 20
    30 sept. 2010 11:10:21 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: using driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://localhost:1433;DatabaseName=Alocpro;
    30 sept. 2010 11:10:21 net.sf.hibernate.connection.DriverManagerConnectionProvider configure
    INFO: connection properties: {user=sa, password=gcsi}
    30 sept. 2010 11:10:21 net.sf.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
    INFO: Transaction strategy: net.sf.hibernate.transaction.JDBCTransactionFactory
    30 sept. 2010 11:10:21 net.sf.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
    INFO: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
    30 sept. 2010 11:10:21 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Use scrollable result sets: true
    30 sept. 2010 11:10:21 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Use JDBC3 getGeneratedKeys(): true
    30 sept. 2010 11:10:21 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Optimize cache for minimal puts: false
    30 sept. 2010 11:10:21 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: Query language substitutions: {}
    30 sept. 2010 11:10:21 net.sf.hibernate.cfg.SettingsFactory buildSettings
    INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
    30 sept. 2010 11:10:21 net.sf.hibernate.cfg.Configuration configureCaches
    INFO: instantiating and configuring caches
    30 sept. 2010 11:10:21 net.sf.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    30 sept. 2010 11:10:21 net.sf.hibernate.impl.SessionFactoryObjectFactory addInstance
    INFO: Not binding factory to JNDI, no JNDI name configured
    Exception in thread "main" net.sf.hibernate.MappingException: No persister for: com.hibernate.F000usr
    	at net.sf.hibernate.impl.SessionFactoryImpl.getPersister(SessionFactoryImpl.java:347)
    	at net.sf.hibernate.impl.SessionImpl.getClassPersister(SessionImpl.java:2690)
    	at net.sf.hibernate.impl.SessionImpl.getSQLLoadable(SessionImpl.java:3817)
    	at net.sf.hibernate.impl.SessionImpl.findBySQL(SessionImpl.java:3796)
    	at net.sf.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:52)
    	at Test.main(Test.java:13)
    A priori ca m'a l'air correct...mais ca me retourne rien...

  4. #4
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    tu inclue bien ton mapping dans ton hibernate.cfg.xml?

  5. #5
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    En fait , je viens de m'apercevoir en fouillant sur les forums que je n'avais pas intégrer la ligne :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    <!-- <mapping resource="src/F000usr.hbm.xml"/>-->
    <mapping resource="src/F000usr.hbm.xml"/>
    Mais à priori il ne trouve pas mon fichier qui se trouve dans :

    Projet Hibernate / Rep src / F000usr.hbm

    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
     
     
    Exception in thread "main" java.lang.ExceptionInInitializerError
    	at Test.main(Test.java:9)
    Caused by: java.lang.RuntimeException: Problème de configuration : Resource: src/F000usr.hbm.xml not found
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:16)
    	... 1 more
    Caused by: net.sf.hibernate.MappingException: Resource: src/F000usr.hbm.xml not found
    	at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:334)
    	at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
    	at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
    	at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
    	at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:14)
    	... 1 more
    Dois-je ajouter l'extension .xml sur mon fichier hbm ?
    Sinon, je crois avoir mis le bon chemin...

  6. #6
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    retire ce src, il n'apparait pas dans le classpath, il ne sert qu'à la compilation.

  7. #7
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    J'ai toujours la meme erreur, il ne me trouve pas le fichier...

    Dans mon projet, j'ai deux packages : un par défaut et un autre com.hibernate.
    Dans le par défaut j'ai mon fichier Test.java
    Dans mon com.hibernate, j'ai mon fichier F000usr.java et HibernateUtil.java.

    Tous mes hbm sont à la racine (dans src), sinon est ce que je dois les déplacer dans un autre repertoire ?

    Ah je crois avoir trouvé...j'ai renommé mon fichier F000usr.hbm en F000usr.hbm.xml, et il ma trouvé le fichier mais j'ai une nouvelle erreur qui est :
    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
     
     
    INFO: Mapping resource: F000usr.hbm.xml
    30 sept. 2010 12:01:54 net.sf.hibernate.cfg.Binder bindRootClass
    INFO: Mapping class: com.hibernate.F000usr -> F000USR
    30 sept. 2010 12:01:54 net.sf.hibernate.cfg.Configuration add
    GRAVE: Could not compile the mapping document
    net.sf.hibernate.MappingException: Could not find class: F050tiers
    	at net.sf.hibernate.cfg.Binder.bindManyToOne(Binder.java:635)
    	at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1034)
    	at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:362)
    	at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
    	at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
    	at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:288)
    	at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
    	at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
    	at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
    	at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
    	at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:14)
    	at Test.main(Test.java:9)
    Exception in thread "main" java.lang.ExceptionInInitializerError
    	at Test.main(Test.java:9)
    Caused by: java.lang.RuntimeException: Problème de configuration : Error reading resource: F000usr.hbm.xml
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:16)
    	... 1 more
    Caused by: net.sf.hibernate.MappingException: Error reading resource: F000usr.hbm.xml
    	at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:339)
    	at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:1013)
    	at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:969)
    	at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
    	at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:14)
    	... 1 more
    Caused by: net.sf.hibernate.MappingException: Could not find class: F050tiers
    	at net.sf.hibernate.cfg.Binder.bindManyToOne(Binder.java:635)
    	at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1034)
    	at net.sf.hibernate.cfg.Binder.bindRootClass(Binder.java:362)
    	at net.sf.hibernate.cfg.Binder.bindRoot(Binder.java:1256)
    	at net.sf.hibernate.cfg.Configuration.add(Configuration.java:252)
    	at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:288)
    	at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
    	... 6 more
    Est ce que je dois renommer tous mes fichiers hbm en hbm.xml et les mapper dans mon fichier de configuration ?

  8. #8
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    J'ai mis en commentaire toute la partie <many_to-one> et <set> dans mon fichier F000usr.hbm.xml.

    j'ai maintenant l'erreur 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
    
    INFO: cache provider: net.sf.hibernate.cache.EhCacheProvider
    30 sept. 2010 12:55:17 net.sf.hibernate.cfg.Configuration configureCaches
    INFO: instantiating and configuring caches
    30 sept. 2010 12:55:17 net.sf.hibernate.impl.SessionFactoryImpl <init>
    INFO: building session factory
    Exception in thread "main" java.lang.ExceptionInInitializerError
    	at Test.main(Test.java:9)
    Caused by: java.lang.RuntimeException: Problème de configuration : Object class com.hibernate.F000usr must declare a default (no-argument) constructor
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:16)
    	... 1 more
    Caused by: net.sf.hibernate.PropertyNotFoundException: Object class com.hibernate.F000usr must declare a default (no-argument) constructor
    	at net.sf.hibernate.util.ReflectHelper.getDefaultConstructor(ReflectHelper.java:138)
    	at net.sf.hibernate.persister.AbstractEntityPersister.<init>(AbstractEntityPersister.java:562)
    	at net.sf.hibernate.persister.EntityPersister.<init>(EntityPersister.java:716)
    	at net.sf.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:42)
    	at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:136)
    	at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
    	at com.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:14)
    	... 1 more
    Ca à l'air d'être un problème de constructeur...mais je ne vois pas ou...

  9. #9
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Bonjour,

    com.hibernate.F000usr must declare a default (no-argument) constructor
    tu dois ajouter un constructeur dans l'entité F000usr.
    A+.

  10. #10
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    il m'indique une erreur quand je le rentre manuellement,ou dois je le rentrer dans ma classe F000usr.java ?

    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
     
     
    package com.hibernate;
     
    import java.io.Serializable;
    import net.sf.hibernate.PersistentEnum;
     
    /**
     * This class has been automatically generated by Hibernate Synchronizer.
     * For more information or documentation, visit The Hibernate Synchronizer page
     * at http://www.binamics.com/hibernatesync or contact Joe Hudson at joe@binamics.com.
     */
     
     
     
    @SuppressWarnings("deprecation")
     
     
     
    public class F000usr implements Serializable,PersistentEnum  {
     
    	/**
             * 
             */
     
    	private static final long serialVersionUID = 6137497370677628315L;
    	public static final F000usr WEB_USER = new F000usr(69);
    	public static final F000usr PROFIL_C_O_M = new F000usr(64);
    	public static final F000usr EQUIPE_DÉVELOPPEMENT = new F000usr(65);
    	public static final F000usr DEMO_USER = new F000usr(200);
    	public static final F000usr PROFIL_D_E_V1 = new F000usr(66);
    	public static final F000usr PROFIL_G_R_O_U_P_E = new F000usr(67);
    	public static final F000usr GESTIONNAIRE_T_H_E_M_6 = new F000usr(128);
    	public static final F000usr DIMITRI_CELLIER = new F000usr(950);
    	public static final F000usr USER_INTRANET = new F000usr(400);
    	public static final F000usr PROFIL_P_R_O_F_I_L = new F000usr(79);
    	public static final F000usr ANGLAIS = new F000usr(21);
    	public static final F000usr D_U_C_H_E_M_I_N_GUILLAUME = new F000usr(90);
    	public static final F000usr A_M_I_A_R_D_CYRIL = new F000usr(34);
    	public static final F000usr VEGA_MESSAGERIE_GROUPE = new F000usr(102);
    	public static final F000usr P_A_G_N_I_E_R_ALINE = new F000usr(103);
    	public static final F000usr UTILISATEUR_P_D_A = new F000usr(652);
    	public static final F000usr F_I_L_A_L_I_AKIM = new F000usr(109);
    	public static final F000usr ROBOT = new F000usr(106);
    	public static final F000usr SERVICE_DÉVELOPPEMENT = new F000usr(47);
    	public static final F000usr C_O_M_P_T_O_I_RFZEFZ = new F000usr(50);
    	public static final F000usr B_E_L_L_I_S_S_A_R_D_CHRISTOPHE = new F000usr(909);
    	public static final F000usr ADMINISTRATEUR_SYSTEME = new F000usr(49);
    	public static final F000usr D_U_H_E_M_DANIEL = new F000usr(908);
    	public static final F000usr MAINTENANCE_ATELIER = new F000usr(48);
    	public static final F000usr G_A_R_N_I_E_R_RENAUD = new F000usr(907);
    	public static final F000usr B_R_I_L_L_O_SÉBASTIEN = new F000usr(906);
    	public static final F000usr C_A_S_E_OLIVIER = new F000usr(904);
    	public static final F000usr SERVICE_COMMERCIAL = new F000usr(126);
    	public static final F000usr V_A_L_E_S_A_JEAN_PIERRE = new F000usr(902);
    	public static final F000usr P_A_G_N_I_E_R_BERNARD = new F000usr(901);
     
    	private final int code;
     
     
     
    	protected F000usr(int code) {
    		this.code = code;
    	}
     
    	public int toInt() { return code; }
     
     
     
    	public static F000usr fromInt(int code) {
    		switch (code) {
    			case 69: return WEB_USER;
    			case 64: return PROFIL_C_O_M;
    			case 65: return EQUIPE_DÉVELOPPEMENT;
    			case 200: return DEMO_USER;
    			case 66: return PROFIL_D_E_V1;
    			case 67: return PROFIL_G_R_O_U_P_E;
    			case 128: return GESTIONNAIRE_T_H_E_M_6;
    			case 950: return DIMITRI_CELLIER;
    			case 400: return USER_INTRANET;
    			case 79: return PROFIL_P_R_O_F_I_L;
    			case 21: return ANGLAIS;
    			case 90: return D_U_C_H_E_M_I_N_GUILLAUME;
    			case 34: return A_M_I_A_R_D_CYRIL;
    			case 102: return VEGA_MESSAGERIE_GROUPE;
    			case 103: return P_A_G_N_I_E_R_ALINE;
    			case 652: return UTILISATEUR_P_D_A;
    			case 109: return F_I_L_A_L_I_AKIM;
    			case 106: return ROBOT;
    			case 47: return SERVICE_DÉVELOPPEMENT;
    			case 50: return C_O_M_P_T_O_I_RFZEFZ;
    			case 909: return B_E_L_L_I_S_S_A_R_D_CHRISTOPHE;
    			case 49: return ADMINISTRATEUR_SYSTEME;
    			case 908: return D_U_H_E_M_DANIEL;
    			case 48: return MAINTENANCE_ATELIER;
    			case 907: return G_A_R_N_I_E_R_RENAUD;
    			case 906: return B_R_I_L_L_O_SÉBASTIEN;
    			case 904: return C_A_S_E_OLIVIER;
    			case 126: return SERVICE_COMMERCIAL;
    			case 902: return V_A_L_E_S_A_JEAN_PIERRE;
    			case 901: return P_A_G_N_I_E_R_BERNARD;
    			default: throw new RuntimeException("Unknown value: " + code);
    		}
    	}
     
    	public String toString () {
    		switch (code) {
    			case 69: return "Web User";
    			case 64: return "Profil : COM";
    			case 65: return "Equipe développement";
    			case 200: return "DEMO USER";
    			case 66: return "Profil : DEV1";
    			case 67: return "Profil : GROUPE";
    			case 128: return "Gestionnaire THEM 6";
    			case 950: return "Dimitri Cellier";
    			case 400: return "User intranet";
    			case 79: return "Profil : PROFIL";
    			case 21: return "ANGLAIS";
    			case 90: return "DUCHEMIN Guillaume";
    			case 34: return "AMIARD Cyril";
    			case 102: return "VEGA MESSAGERIE GROUPE";
    			case 103: return "PAGNIER Aline";
    			case 652: return "Utilisateur PDA";
    			case 109: return "FILALI Akim";
    			case 106: return "Robot";
    			case 47: return "Service développement";
    			case 50: return "COMPTOIRfzefz";
    			case 909: return "BELLISSARD Christophe";
    			case 49: return "Administrateur Systeme";
    			case 908: return "DUHEM Daniel";
    			case 48: return "MAINTENANCE, ATELIER";
    			case 907: return "GARNIER Renaud";
    			case 906: return "BRILLO Sébastien";
    			case 904: return "CASE Olivier";
    			case 126: return "Service commercial";
    			case 902: return "VALESA Jean-Pierre";
    			case 901: return "PAGNIER Bernard";
    			default: return "Unknown value";
    		}
     
    	}
     
    }

  11. #11
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Dans la class F000usr.java.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    ...
    public F000usr(){
    }
    protected F000usr(int code) {
            this.code = code;
        }
    ...

  12. #12
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    Citation Envoyé par ulrichv Voir le message
    il m'indique une erreur quand je le rentre manuellement,ou dois je le rentrer dans ma classe F000usr.java ?
    A n'importe quel endroit où l'on peux mettre un constructeur -> Si tu ne sais pas où mettre un constructeur, je te conseille fortement de stabiliser tes bases en java avant d'apprendre des choses comme hibernate.

  13. #13
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    Lorsque je l'insère, il me souligne F000usr, et me donne le message suivant :

    Le champs final vide code ne peut pas avoir été initialisé

  14. #14
    Rédacteur/Modérateur
    Avatar de andry.aime
    Homme Profil pro
    Inscrit en
    Septembre 2007
    Messages
    8 391
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Ile Maurice

    Informations forums :
    Inscription : Septembre 2007
    Messages : 8 391
    Par défaut
    Je te conseille se suivre ceux que disait tchiz_ plus haut.
    Pourquoi tous ces instanciations en dur dans la class? ces switch? ces valeurs ne sont pas censé être ceux que tu veux lire dans la base de donnée?

    A+.

  15. #15
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    Je suis en période de stage et je dois terminer mon projet dans peu de temps...J'ai effectué tous mon apprentissage en C# et on m'a demandé de travaillé sous Eclipse en java afin d'etudier le single-sourcing....J'ai effectué les 3/4 du chemin mais je bloque uniquement sur cet aspect là...

    J'ai déjà effectué des connexions et lecture de base de donnée sans passer par hibernate...Et j'ai un peu de mal à comprendre (malgré avoir passé quelques heures là dessus) le mécanisme d'hibernate.

    Hibernate m'a créé ce fichier Fwexemple quand j'ai créé la connexion que j'ai ensuite renommé...
    J'ai pas très bien compris pourquoi j'ai mais s'il faut les virer, c'est pas un problème...Je cherche le moyen le plus rapide pour m'afficher le résultat de mon select...

  16. #16
    Membre averti
    Inscrit en
    Juin 2009
    Messages
    51
    Détails du profil
    Informations forums :
    Inscription : Juin 2009
    Messages : 51
    Par défaut
    C'est OK, j'ai modifié le contenu complet de mon fichier F000usr.java et maintenant tout est OK.

    Merci à tchize_ et andry.aime

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

Discussions similaires

  1. [SQL-Server] Syntaxe sur une requete
    Par Cobax dans le forum PHP & Base de données
    Réponses: 1
    Dernier message: 04/05/2009, 18h16
  2. erreur de syntaxe sur la requete iif sous sql access
    Par nadia123456 dans le forum Requêtes et SQL.
    Réponses: 6
    Dernier message: 29/08/2008, 15h32
  3. Erreur de syntaxe sur une Requete Update
    Par samtheh dans le forum Requêtes et SQL.
    Réponses: 1
    Dernier message: 01/06/2007, 13h07
  4. Sechage sur syntaxe de requete
    Par wonderyan dans le forum PostgreSQL
    Réponses: 8
    Dernier message: 27/03/2007, 12h18
  5. [SQL] Erreur de syntaxe sur requete complexe
    Par tiger33 dans le forum PHP & Base de données
    Réponses: 3
    Dernier message: 07/11/2006, 09h54

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