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 :

fichier de mapping incorect


Sujet :

Hibernate Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Mars 2006
    Messages : 111
    Par défaut fichier de mapping incorect
    Bonjour,

    Je suis assez nouveau dans le monde d'hibernate et ai encore quelques problèmes. J'ai fait un fichier de config valide, mais ai quelques soucis avec mon fichier de mapping. Voila le fichier en question :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
    <?xml version="1.0"?>
    <!DOCTYPE hibernate-mapping PUBLIC
       "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
    <hibernate-mapping package="com.genebio.toxico.compound">
        <class name="CompoundImpl" table="COMPOUND">
            <id name="id" column="COMPOUND_ID">
                <generator class="native"/>
            </id>
            <property name="cid" type="string" column="COMPOUND_CID"/>
            <property name="SMILE" type="string" column="COMPOUND_SMILE"/>
        </class>
    </hibernate-mapping>
    Mais quand je lance ma console hibernate sous eclipse, elle me dit :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    org.hibernate.MappingException: invalid mapping
    org.hibernate.MappingException: invalid mapping
    org.xml.sax.SAXParseException: Element "class" requires additional elements.
    Une idée ?

  2. #2
    Membre éprouvé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2003
    Messages
    1 309
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2003
    Messages : 1 309
    Par défaut
    Un type dans l'id ?

  3. #3
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Mars 2006
    Messages : 111
    Par défaut
    Effectivement c'est une bonne idée, mais meme avec ca ne marche toujours pas...

  4. #4
    Membre éprouvé
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2003
    Messages
    1 309
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Seine Saint Denis (Île de France)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Service public

    Informations forums :
    Inscription : Avril 2003
    Messages : 1 309
    Par défaut
    Le reste correspond à ce que j'ai dans mes applis. Le problème vient peut-être d'ailleurs.

  5. #5
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Mars 2006
    Messages : 111
    Par défaut
    Alors peut-etre, mais du coup, ca m'arrange pas...

  6. #6
    Membre chevronné
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    365
    Détails du profil
    Informations personnelles :
    Localisation : Maroc

    Informations forums :
    Inscription : Janvier 2006
    Messages : 365
    Par défaut
    Tu peux nous montrer ta classe CompoundImpl ?

  7. #7
    Membre confirmé
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    111
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Mars 2006
    Messages : 111
    Par défaut
    oui la voici :

    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
     
    package com.genebio.toxico.compound;
     
     * Basic class for the compound object
     
    import java.util.ArrayList;
     
    public class CompoundImpl extends CompoundImplBase implements Serializable{
     
    	protected String cid;
    	protected int id;
    	protected String SMILE;
    	protected ArrayList<CompoundDescriptor> compoundDescriptors;
    	protected ArrayList<CompoundName> compoundNames;
    	protected ArrayList<CompoundClassification> compoundclassification;
    	protected ArrayList<CompoundCorrelation> compoundcorrelations;
    	protected ArrayList<CompoundXref> compoundXrefs;
     
    	//minimum information for a compound
    	public CompoundImpl(int id, String cid, String SMILE){
    		this.id 					= id;
    		this.cid 					= cid;
    		this.SMILE 					= SMILE;	
    	}
     
    	//primary information for a compound
    	public CompoundImpl(int id, String cid, String SMILE, 
    			ArrayList<CompoundDescriptor> compoundDescriptors, 
    			ArrayList<CompoundName> compoundNames, 
    			ArrayList<CompoundXref> compoundXrefs
    			){
     
    		this.id 					= id;
    		this.cid 					= cid;
    		this.SMILE 					= SMILE;
    		this.compoundDescriptors	= compoundDescriptors;
    		this.compoundNames			= compoundNames;
    		this.compoundXrefs			= compoundXrefs;
    }
     
    	//future information for a compound (correlation and classification informations are added)
    	public CompoundImpl(int id, String cid, String SMILE, 
    					ArrayList<CompoundDescriptor> compoundDescriptors, 
    					ArrayList<CompoundName> compoundNames, 
    					ArrayList<CompoundXref> compoundXrefs,
    					ArrayList<CompoundClassification> compoundclassification, 
    					ArrayList<CompoundCorrelation> compoundcorrelations 
    					){
     
    		this.id 					= id;
    		this.cid 					= cid;
    		this.SMILE 					= SMILE;
    		this.compoundclassification	= compoundclassification;
    		this.compoundcorrelations	= compoundcorrelations;
    		this.compoundDescriptors	= compoundDescriptors;
    		this.compoundNames			= compoundNames;
    		this.compoundXrefs			= compoundXrefs;
    	}
     
     
    	public String getSMILE(){
    		return SMILE;
    	}
     
    	public ArrayList<CompoundClassification> getCompoundclassification() {
    		return compoundclassification;
    	}
     
    	public void setCompoundclassification(
    			ArrayList<CompoundClassification> compoundclassification) {
    		this.compoundclassification = compoundclassification;
    	}
     
    	public ArrayList<CompoundCorrelation> getCompoundcorrelations() {
    		return compoundcorrelations;
    	}
     
    	public void setCompoundcorrelations(
    			ArrayList<CompoundCorrelation> compoundcorrelations) {
    		this.compoundcorrelations = compoundcorrelations;
    	}
     
    	public ArrayList<CompoundDescriptor> getCompoundDescriptors() {
    		return compoundDescriptors;
    	}
     
    	public void setCompoundDescriptors(
    			ArrayList<CompoundDescriptor> compoundDescriptors) {
    		this.compoundDescriptors = compoundDescriptors;
    	}
     
    	public ArrayList<CompoundName> getCompoundNames() {
    		return compoundNames;
    	}
     
    	public void setCompoundNames(ArrayList<CompoundName> compoundNames) {
    		this.compoundNames = compoundNames;
    	}
     
    	public ArrayList<CompoundXref> getCompoundXrefs() {
    		return compoundXrefs;
    	}
     
    	public void setCompoundXrefs(ArrayList<CompoundXref> compoundXrefs) {
    		this.compoundXrefs = compoundXrefs;
    	}
     
    	public int getId() {
    		return id;
    	}
     
    	public String getCid() {
    		return cid;
    	}
     
    }

  8. #8
    Membre chevronné
    Profil pro
    Inscrit en
    Janvier 2006
    Messages
    365
    Détails du profil
    Informations personnelles :
    Localisation : Maroc

    Informations forums :
    Inscription : Janvier 2006
    Messages : 365
    Par défaut
    Je ne vois rien d'anormal mon non plus, il se pourrait que le problème vienne d'ailleurs.

Discussions similaires

  1. Fichier de mapping introuvable
    Par mymyma dans le forum Hibernate
    Réponses: 9
    Dernier message: 16/08/2006, 18h38
  2. 2 tables 2 fichiers de mapping 1 classe java
    Par Galak extra dans le forum Hibernate
    Réponses: 6
    Dernier message: 10/08/2006, 20h05
  3. [Hibernate] Fichier de mapping introuvable
    Par babylone7 dans le forum Hibernate
    Réponses: 3
    Dernier message: 06/01/2006, 17h06
  4. [HIBERNATE] Fichier de mapping
    Par SEMPERE Benjamin dans le forum Hibernate
    Réponses: 2
    Dernier message: 20/10/2005, 10h40
  5. [Hibernate] [Eclipse] Création du fichier de mapping
    Par Willy7901 dans le forum Eclipse Java
    Réponses: 2
    Dernier message: 11/08/2005, 17h54

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