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 :

Problème de mapping Foreign key must have same number of columns as the referenced primary key


Sujet :

Hibernate Java

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    188
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 188
    Points : 140
    Points
    140
    Par défaut Problème de mapping Foreign key must have same number of columns as the referenced primary key
    Bonjour, après avoir passé deux jours a chercher je n'ai trouver aucune explication a mon problème :

    J'ai un ensemble de tables... le problème viens des association je présume :

    voila mes fichiers de mapping mais qui ne marchent pas :

    mapping A.hbm.xml
    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
     
    <!--  CLASS CATEGORISATION ENTREPRISE -->
        <class name="package.name.Categorisationentreprise" table="categorisationentreprise" schema="public">
    <!--  PK  -->
            <id name="categorisationentrepriseId" type="int">
                <column name="categorisationentreprise_id" />
                <generator class="assigned" />
            </id>
    <!--  REFERENCES  -->
            <many-to-one name="entreprise" class="package.name.Entreprise" fetch="select" >
    			<column name="entreprisedonneesgestion_id" not-null="true" /> 
            </many-to-one>
     
     
    <!--simple properties-->
            <property name="nom" type="short">
                <column name="nom" not-null="true" />
            </property>
            <property name="sigle" type="short">
                <column name="sigle" not-null="true" />
            </property>
        </class>
    </hibernate-mapping>

    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
     
    <!-- CLASS ENTREPRISE   -->
        <class name="package.name.Entreprise" table="entreprise" schema="public">
    <!-- PK  -->
            <composite-id name="id" class="package.name.EntrepriseId">
                <key-property name="acteurObjetId" type="int">
                    <column name="acteur_objet_id" />
                </key-property>
                <key-property name="objetId" type="int">
                    <column name="objet_id" />
                </key-property>
            </composite-id>
     
    <!-- REFERENCES  -->
     
    ....
            <set name="categorisationentreprises" inverse="true">
                <key>
                    <column name="entreprisedonneesgestion_id" not-null="true" />
                </key>
                <one-to-many class="package.name.Categorisationentreprise" /> 
            </set>
    ....
        </class>
    J'ai toujours ce message :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Caused by: org.hibernate.MappingException: Foreign key (FKC2D2CE6B2A3B6F15:categorisationentreprise [entreprisedonneesgestion_id])) must have same number of columns as the referenced primary key (entreprise [acteur_objet_id,objet_id])
    Je cherche l'erreur mais j'ai aucune idée sachant que je suis nouveau dans le monde Hibernate

    Merci

  2. #2
    Membre chevronné
    Inscrit en
    Août 2009
    Messages
    1 073
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 1 073
    Points : 1 806
    Points
    1 806
    Par défaut
    Eh bien il te dit que l'association ne peut se faire, vu que dans l'association tu lui définis la Categorisation avec une seule valeur, alors qu'elle est normalement définie avec 2 (la clé primaire, composite).

    Donc ou bien ton association est mal pensée (il manque une colonne), ou bien ta clé primaire devrait être simplifiée.

  3. #3
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    188
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 188
    Points : 140
    Points
    140
    Par défaut
    Alors je vais plutôt détaillé le schéma rapidement il me parait propre :

    Table A
    -------
    PK : a


    Table B
    -------
    PK : b


    Table C
    -------
    PK : c

    Table D (entreprise dans mon poste précédent)
    -------
    PK : d1 (A_a, B_b)
    FK : d2 (C_c de la table C)


    Table E (Catégorie dans mon poste précédent
    --------
    PK : e
    FK : e2 (qui est D_d2)

    Et donc le mapping précédent était pour les tables D et E

  4. #4
    Membre chevronné
    Inscrit en
    Août 2009
    Messages
    1 073
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 1 073
    Points : 1 806
    Points
    1 806
    Par défaut
    Tu ne peux pas faire autrement ?

    Sinon, si ta FK est unique, tu peux alors la déclarer unique, et l'utiliser en property-ref.

    Cela dit, je crois que ça merde quand même en conjonction avec une clé composite sur de vieilles version d'hibernate ...

    Pour faire autrement : puisque ta FK pointe vers la table C, tu peux faire une jointure qui semble naturelle entre C et E ; et bien sûr la jointure en C et D. De là tu peux récupérer la propriété E sur D.

  5. #5
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    188
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 188
    Points : 140
    Points
    140
    Par défaut
    Merci pour toutes ses réponses Rei Ichido, cela dit comme je suis nouveau dans le monde BD et hibernate peut tu me donné un exemple pour les solutions que tu m'as données. ou comment répercuter ses changements sur mon projet .

    Merci bien

  6. #6
    Membre chevronné
    Inscrit en
    Août 2009
    Messages
    1 073
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 1 073
    Points : 1 806
    Points
    1 806
    Par défaut
    En utilisant une property-ref :

    Dans CATEGORISATION ENTREPRISE
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
            <many-to-one name="entreprise" class="package.name.Entreprise" fetch="select" property-ref="_le_nom_de_la_propriete_d2_dans_la_classe">
    		<column name="entreprisedonneesgestion_id" not-null="true" /> 
            </many-to-one>
    Cela dit, il faut pour que ça passe signifier que la propriété est unique :

    Dans ENTREPRISE
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
          <property name="_le_nom_de_la_propriete_d2_dans_la_classe" unique="true">
                <column name="entreprisedonneesgestion_id" />
           </property>

  7. #7
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    188
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 188
    Points : 140
    Points
    140
    Par défaut
    Merci pour les infos , justement j'avais trouver l'astuce sur le net et effectuer les changement comme tu l'as présenter donc le mapping se passe bien mais:

    La classe entreprise a un set d'établissements le mapping est le suivant:

    Dans entreprise :

    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
     
    <!-- PK  -->
            <composite-id name="id" class="package.name.EntrepriseId">
                <key-property name="acteurObjetId" type="int">
                    <column name="acteur_objet_id" />
                </key-property>
                <key-property name="objetId" type="int">
                    <column name="objet_id" />
                </key-property>
            </composite-id>
     
            <property name="entreprisedonneesgestionId" unique="true" insert="false" update="false">
                <column name="entreprisedonneesgestion_id" />
           	</property>    
    <!-- REFERENCES  -->
     
            <set name="etablissements" inverse="true">
                <key property-ref="entreprisedonneesgestionId">
                    <column name="entreprisedonneesgestion_id" not-null="true" />
                </key>
                <one-to-many class="package.name.Etablissement" />
            </set>

    et dans établissement :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
     
     
            <composite-id name="id" class="package.name.EtablissementId">
                <key-property name="acteurObjetId" type="int">
                    <column name="acteur_objet_id" />
                </key-property>
                <key-property name="objetId" type="int">
                    <column name="objet_id" />
                </key-property>
            </composite-id>
     
            <many-to-one name="entreprise" class="package.name.Entreprise" fetch="select" property-ref="entreprisedonneesgestionId">
                <column name="entreprisedonneesgestion_id" not-null="true" />
            </many-to-one>
    Mon code de test est très simple :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
    		Entreprise en= e.findById(new EntrepriseId(6,7));
    		en.getEtablissements().size();
    et l'erreur magnifique :
    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
     
    Exception in thread "main" org.hibernate.PropertyAccessException: IllegalArgumentException occurred calling getter of package.name.EntrepriseId.acteurObjetId
    	at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:198)
    	at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValue(AbstractComponentTuplizer.java:77)
    	at org.hibernate.tuple.component.AbstractComponentTuplizer.getPropertyValues(AbstractComponentTuplizer.java:83)
    	at org.hibernate.tuple.component.PojoComponentTuplizer.getPropertyValues(PojoComponentTuplizer.java:108)
    	at org.hibernate.type.ComponentType.getPropertyValues(ComponentType.java:382)
    	at org.hibernate.type.ComponentType.getHashCode(ComponentType.java:213)
    	at org.hibernate.engine.EntityKey.generateHashCode(EntityKey.java:126)
    	at org.hibernate.engine.EntityKey.<init>(EntityKey.java:70)
    	at org.hibernate.engine.StatefulPersistenceContext.getCollectionOwner(StatefulPersistenceContext.java:734)
    	at org.hibernate.loader.Loader.readCollectionElement(Loader.java:1141)
    	at org.hibernate.loader.Loader.readCollectionElements(Loader.java:774)
    	at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:622)
    	at org.hibernate.loader.Loader.doQuery(Loader.java:829)
    	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
    	at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
    	at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)
    	at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627)
    	at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
    	at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863)
    	at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)
    	at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
    	at org.hibernate.collection.AbstractPersistentCollection.readSize(AbstractPersistentCollection.java:134)
    	at org.hibernate.collection.PersistentSet.size(PersistentSet.java:162)
    	at com.acoss.tests.TestEntreprise.main(TestEntreprise.java:26)
    Caused by: java.lang.IllegalArgumentException: object is not an instance of declaring class
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:172)
    	... 23 more

    La classe EntrepriseId est la classe générer par hibernate tools pour la clé composé

    Merci

  8. #8
    Membre chevronné
    Inscrit en
    Août 2009
    Messages
    1 073
    Détails du profil
    Informations forums :
    Inscription : Août 2009
    Messages : 1 073
    Points : 1 806
    Points
    1 806
    Par défaut
    Tu pourrais fournir le code de tes classes ?

  9. #9
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    188
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 188
    Points : 140
    Points
    140
    Par défaut
    Oui biensur :

    voila la classe entreprise :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
     
    package package.name.domain;
    // Generated 23 déc. 2010 16:15:48 by Hibernate Tools 3.1.0.beta4
     
    import java.util.Date;
    import java.util.HashSet;
    import java.util.Set;
     
     
    /**
     * Entreprise generated by hbm2java
     */
     
    public class Entreprise  implements java.io.Serializable {
     
     
        // Fields    
     
         private EntrepriseId id;
         private Entreprise entrepriseByEntrepriseEntreprisedonneesgestionId;
         private EntiteCotisante entiteCotisante;
         private Entreprise entrepriseByCol21;
         private Entreprisedonneesgestion entreprisedonneesgestion;
         private Firmeetrangere firmeetrangere;
         private String siren;
         private String denomination;
         private String formejuridiqueinsee;
         private String nomcommercial;
         private String descriptionactiviteprincipale;
         private short codenaf;
         private short origineformejuridiqueinsee;
         private String norm;
         private short norcs;
         private Date datecreation;
         private Date datecessation;
         private Date datedisparition;
         private Date datemisenlocgerance;
         private int entreprisedonneesgestionId;
         private int entreprise_entreprisedonneesgestionId;
         private int col_21 ;
         private Set<Etablissement> etablissements = new HashSet<Etablissement>();
         private Set<IndividusRedevable> individusRedevables = new HashSet<IndividusRedevable>();
         private Set<Entreprise> entreprisesForEntrepriseEntreprisedonneesgestionId = new HashSet<Entreprise>();
         private Set<Lienentreprise> lienentreprises = new HashSet<Lienentreprise>();
         private Set<Entreprise> entreprisesForCol21 = new HashSet<Entreprise>();
         private Set<Categorisationentreprise> categorisationentreprises = new HashSet<Categorisationentreprise>();
         private Set<Certification> certifications = new HashSet<Certification>();
     
     
        // Constructors
     
        /** default constructor */
        public Entreprise() {
        }
     
    	/** minimal constructor */
        public Entreprise(EntrepriseId id, EntiteCotisante entiteCotisante, Entreprise entrepriseByCol21, String siren, String denomination, String formejuridiqueinsee, String nomcommercial, String descriptionactiviteprincipale, short codenaf, short origineformejuridiqueinsee, String norm, short norcs, Date datecreation, Date datecessation, Date datedisparition, Date datemisenlocgerance) {
            this.id = id;
            this.entiteCotisante = entiteCotisante;
            this.entrepriseByCol21 = entrepriseByCol21;
            this.siren = siren;
            this.denomination = denomination;
            this.formejuridiqueinsee = formejuridiqueinsee;
            this.nomcommercial = nomcommercial;
            this.descriptionactiviteprincipale = descriptionactiviteprincipale;
            this.codenaf = codenaf;
            this.origineformejuridiqueinsee = origineformejuridiqueinsee;
            this.norm = norm;
            this.norcs = norcs;
            this.datecreation = datecreation;
            this.datecessation = datecessation;
            this.datedisparition = datedisparition;
            this.datemisenlocgerance = datemisenlocgerance;
        }
     
        /** full constructor */
        public Entreprise(EntrepriseId id, Entreprise entrepriseByEntrepriseEntreprisedonneesgestionId, EntiteCotisante entiteCotisante, Entreprise entrepriseByCol21, Entreprisedonneesgestion entreprisedonneesgestion, Firmeetrangere firmeetrangere, String siren, String denomination, String formejuridiqueinsee, String nomcommercial, String descriptionactiviteprincipale, short codenaf, short origineformejuridiqueinsee, String norm, short norcs, Date datecreation, Date datecessation, Date datedisparition, Date datemisenlocgerance, Set<Etablissement> etablissements, Set<IndividusRedevable> individusRedevables, Set<Entreprise> entreprisesForEntrepriseEntreprisedonneesgestionId, Set<Lienentreprise> lienentreprises, Set<Entreprise> entreprisesForCol21, Set<Categorisationentreprise> categorisationentreprises, Set<Certification> certifications) {
            this.id = id;
            this.entrepriseByEntrepriseEntreprisedonneesgestionId = entrepriseByEntrepriseEntreprisedonneesgestionId;
            this.entiteCotisante = entiteCotisante;
            this.entrepriseByCol21 = entrepriseByCol21;
            this.entreprisedonneesgestion = entreprisedonneesgestion;
            this.firmeetrangere = firmeetrangere;
            this.siren = siren;
            this.denomination = denomination;
            this.formejuridiqueinsee = formejuridiqueinsee;
            this.nomcommercial = nomcommercial;
            this.descriptionactiviteprincipale = descriptionactiviteprincipale;
            this.codenaf = codenaf;
            this.origineformejuridiqueinsee = origineformejuridiqueinsee;
            this.norm = norm;
            this.norcs = norcs;
            this.datecreation = datecreation;
            this.datecessation = datecessation;
            this.datedisparition = datedisparition;
            this.datemisenlocgerance = datemisenlocgerance;
            this.etablissements = etablissements;
            this.individusRedevables = individusRedevables;
            this.entreprisesForEntrepriseEntreprisedonneesgestionId = entreprisesForEntrepriseEntreprisedonneesgestionId;
            this.lienentreprises = lienentreprises;
            this.entreprisesForCol21 = entreprisesForCol21;
            this.categorisationentreprises = categorisationentreprises;
            this.certifications = certifications;
        }
     
     
     
        // Property accessors
     
        public EntrepriseId getId() {
            return this.id;
        }
     
        public void setId(EntrepriseId id) {
            this.id = id;
        }
     
        public Entreprise getEntrepriseByEntrepriseEntreprisedonneesgestionId() {
            return this.entrepriseByEntrepriseEntreprisedonneesgestionId;
        }
     
        public void setEntrepriseByEntrepriseEntreprisedonneesgestionId(Entreprise entrepriseByEntrepriseEntreprisedonneesgestionId) {
            this.entrepriseByEntrepriseEntreprisedonneesgestionId = entrepriseByEntrepriseEntreprisedonneesgestionId;
        }
     
        public EntiteCotisante getEntiteCotisante() {
            return this.entiteCotisante;
        }
     
        public void setEntiteCotisante(EntiteCotisante entiteCotisante) {
            this.entiteCotisante = entiteCotisante;
        }
     
        public Entreprise getEntrepriseByCol21() {
            return this.entrepriseByCol21;
        }
     
        public void setEntrepriseByCol21(Entreprise entrepriseByCol21) {
            this.entrepriseByCol21 = entrepriseByCol21;
        }
     
        public Entreprisedonneesgestion getEntreprisedonneesgestion() {
            return this.entreprisedonneesgestion;
        }
     
        public void setEntreprisedonneesgestion(Entreprisedonneesgestion entreprisedonneesgestion) {
            this.entreprisedonneesgestion = entreprisedonneesgestion;
        }
     
        public Firmeetrangere getFirmeetrangere() {
            return this.firmeetrangere;
        }
     
        public void setFirmeetrangere(Firmeetrangere firmeetrangere) {
            this.firmeetrangere = firmeetrangere;
        }
     
        public String getSiren() {
            return this.siren;
        }
     
        public void setSiren(String siren) {
            this.siren = siren;
        }
     
        public String getDenomination() {
            return this.denomination;
        }
     
        public void setDenomination(String denomination) {
            this.denomination = denomination;
        }
     
        public String getFormejuridiqueinsee() {
            return this.formejuridiqueinsee;
        }
     
        public void setFormejuridiqueinsee(String formejuridiqueinsee) {
            this.formejuridiqueinsee = formejuridiqueinsee;
        }
     
        public String getNomcommercial() {
            return this.nomcommercial;
        }
     
        public void setNomcommercial(String nomcommercial) {
            this.nomcommercial = nomcommercial;
        }
     
        public String getDescriptionactiviteprincipale() {
            return this.descriptionactiviteprincipale;
        }
     
        public void setDescriptionactiviteprincipale(String descriptionactiviteprincipale) {
            this.descriptionactiviteprincipale = descriptionactiviteprincipale;
        }
     
        public short getCodenaf() {
            return this.codenaf;
        }
     
        public void setCodenaf(short codenaf) {
            this.codenaf = codenaf;
        }
     
        public short getOrigineformejuridiqueinsee() {
            return this.origineformejuridiqueinsee;
        }
     
        public void setOrigineformejuridiqueinsee(short origineformejuridiqueinsee) {
            this.origineformejuridiqueinsee = origineformejuridiqueinsee;
        }
     
        public String getNorm() {
            return this.norm;
        }
     
        public void setNorm(String norm) {
            this.norm = norm;
        }
     
        public short getNorcs() {
            return this.norcs;
        }
     
        public void setNorcs(short norcs) {
            this.norcs = norcs;
        }
     
        public Date getDatecreation() {
            return this.datecreation;
        }
     
        public void setDatecreation(Date datecreation) {
            this.datecreation = datecreation;
        }
     
        public Date getDatecessation() {
            return this.datecessation;
        }
     
        public void setDatecessation(Date datecessation) {
            this.datecessation = datecessation;
        }
     
        public Date getDatedisparition() {
            return this.datedisparition;
        }
     
        public void setDatedisparition(Date datedisparition) {
            this.datedisparition = datedisparition;
        }
     
        public Date getDatemisenlocgerance() {
            return this.datemisenlocgerance;
        }
     
        public void setDatemisenlocgerance(Date datemisenlocgerance) {
            this.datemisenlocgerance = datemisenlocgerance;
        }
     
        public Set<Etablissement> getEtablissements() {
            return this.etablissements;
        }
     
        public void setEtablissements(Set<Etablissement> etablissements) {
            this.etablissements = etablissements;
        }
     
        public Set<IndividusRedevable> getIndividusRedevables() {
            return this.individusRedevables;
        }
     
        public void setIndividusRedevables(Set<IndividusRedevable> individusRedevables) {
            this.individusRedevables = individusRedevables;
        }
     
        public Set<Entreprise> getEntreprisesForEntrepriseEntreprisedonneesgestionId() {
            return this.entreprisesForEntrepriseEntreprisedonneesgestionId;
        }
     
        public void setEntreprisesForEntrepriseEntreprisedonneesgestionId(Set<Entreprise> entreprisesForEntrepriseEntreprisedonneesgestionId) {
            this.entreprisesForEntrepriseEntreprisedonneesgestionId = entreprisesForEntrepriseEntreprisedonneesgestionId;
        }
     
        public Set<Lienentreprise> getLienentreprises() {
            return this.lienentreprises;
        }
     
        public void setLienentreprises(Set<Lienentreprise> lienentreprises) {
            this.lienentreprises = lienentreprises;
        }
     
        public Set<Entreprise> getEntreprisesForCol21() {
            return this.entreprisesForCol21;
        }
     
        public void setEntreprisesForCol21(Set<Entreprise> entreprisesForCol21) {
            this.entreprisesForCol21 = entreprisesForCol21;
        }
     
        public Set<Categorisationentreprise> getCategorisationentreprises() {
            return this.categorisationentreprises;
        }
     
        public void setCategorisationentreprises(Set<Categorisationentreprise> categorisationentreprises) {
            this.categorisationentreprises = categorisationentreprises;
        }
     
        public Set<Certification> getCertifications() {
            return this.certifications;
        }
     
        public void setCertifications(Set<Certification> certifications) {
            this.certifications = certifications;
        }
     
    	public void setEntreprisedonneesgestionId(int entreprisedonneesgestionId) {
    		this.entreprisedonneesgestionId = entreprisedonneesgestionId;
    	}
     
    	public int getEntreprisedonneesgestionId() {
    		return entreprisedonneesgestionId;
    	}
     
    	public void setEntreprise_entreprisedonneesgestionId(
    			int entreprise_entreprisedonneesgestionId) {
    		this.entreprise_entreprisedonneesgestionId = entreprise_entreprisedonneesgestionId;
    	}
     
    	public int getEntreprise_entreprisedonneesgestionId() {
    		return entreprise_entreprisedonneesgestionId;
    	}
     
    	public void setCol_21(int col_21) {
    		this.col_21 = col_21;
    	}
     
    	public int getCol_21() {
    		return col_21;
    	}
     
     
    }
    puis la classe établissement :
    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
     
    package package.name.domain;
    // Generated 23 déc. 2010 16:15:48 by Hibernate Tools 3.1.0.beta4
     
    import java.util.Date;
    import java.util.HashSet;
    import java.util.Set;
     
     
    /**
     * Etablissement generated by hbm2java
     */
     
    public class Etablissement  implements java.io.Serializable {
     
     
        // Fields    
     
         private EtablissementId id;
         private EntiteCotisante entiteCotisante;
         private Entreprise entreprise;
         private String siret;
         private short nomcommercial;
         private short enseigne;
         private short codenaf;
         private short originecreation;
         private Date datefermeture;
         private Date datecreation;
         private Date datefinactivite;
         private Date datemiselocgerance;
         private String descriptionactivite;
         private short presencepersonnel;
         private short siegesocial;
         private Set<Certification> certifications = new HashSet<Certification>(0);
     
     
        // Constructors
     
        /** default constructor */
        public Etablissement() {
        }
     
    	/** minimal constructor */
        public Etablissement(EtablissementId id, EntiteCotisante entiteCotisante, Entreprise entreprise, String siret, short nomcommercial, short enseigne, short codenaf, short originecreation, Date datefermeture, Date datecreation, Date datefinactivite, Date datemiselocgerance, String descriptionactivite, short presencepersonnel, short siegesocial) {
            this.id = id;
            this.entiteCotisante = entiteCotisante;
            this.entreprise = entreprise;
            this.siret = siret;
            this.nomcommercial = nomcommercial;
            this.enseigne = enseigne;
            this.codenaf = codenaf;
            this.originecreation = originecreation;
            this.datefermeture = datefermeture;
            this.datecreation = datecreation;
            this.datefinactivite = datefinactivite;
            this.datemiselocgerance = datemiselocgerance;
            this.descriptionactivite = descriptionactivite;
            this.presencepersonnel = presencepersonnel;
            this.siegesocial = siegesocial;
        }
     
        /** full constructor */
        public Etablissement(EtablissementId id, EntiteCotisante entiteCotisante, Entreprise entreprise, String siret, short nomcommercial, short enseigne, short codenaf, short originecreation, Date datefermeture, Date datecreation, Date datefinactivite, Date datemiselocgerance, String descriptionactivite, short presencepersonnel, short siegesocial, Set<Certification> certifications) {
            this.id = id;
            this.entiteCotisante = entiteCotisante;
            this.entreprise = entreprise;
            this.siret = siret;
            this.nomcommercial = nomcommercial;
            this.enseigne = enseigne;
            this.codenaf = codenaf;
            this.originecreation = originecreation;
            this.datefermeture = datefermeture;
            this.datecreation = datecreation;
            this.datefinactivite = datefinactivite;
            this.datemiselocgerance = datemiselocgerance;
            this.descriptionactivite = descriptionactivite;
            this.presencepersonnel = presencepersonnel;
            this.siegesocial = siegesocial;
            this.certifications = certifications;
        }
     
     
     
        // Property accessors
     
        public EtablissementId getId() {
            return this.id;
        }
     
        public void setId(EtablissementId id) {
            this.id = id;
        }
     
        public EntiteCotisante getEntiteCotisante() {
            return this.entiteCotisante;
        }
     
        public void setEntiteCotisante(EntiteCotisante entiteCotisante) {
            this.entiteCotisante = entiteCotisante;
        }
     
        public Entreprise getEntreprise() {
            return this.entreprise;
        }
     
        public void setEntreprise(Entreprise entreprise) {
            this.entreprise = entreprise;
        }
     
        public String getSiret() {
            return this.siret;
        }
     
        public void setSiret(String siret) {
            this.siret = siret;
        }
     
        public short getNomcommercial() {
            return this.nomcommercial;
        }
     
        public void setNomcommercial(short nomcommercial) {
            this.nomcommercial = nomcommercial;
        }
     
        public short getEnseigne() {
            return this.enseigne;
        }
     
        public void setEnseigne(short enseigne) {
            this.enseigne = enseigne;
        }
     
        public short getCodenaf() {
            return this.codenaf;
        }
     
        public void setCodenaf(short codenaf) {
            this.codenaf = codenaf;
        }
     
        public short getOriginecreation() {
            return this.originecreation;
        }
     
        public void setOriginecreation(short originecreation) {
            this.originecreation = originecreation;
        }
     
        public Date getDatefermeture() {
            return this.datefermeture;
        }
     
        public void setDatefermeture(Date datefermeture) {
            this.datefermeture = datefermeture;
        }
     
        public Date getDatecreation() {
            return this.datecreation;
        }
     
        public void setDatecreation(Date datecreation) {
            this.datecreation = datecreation;
        }
     
        public Date getDatefinactivite() {
            return this.datefinactivite;
        }
     
        public void setDatefinactivite(Date datefinactivite) {
            this.datefinactivite = datefinactivite;
        }
     
        public Date getDatemiselocgerance() {
            return this.datemiselocgerance;
        }
     
        public void setDatemiselocgerance(Date datemiselocgerance) {
            this.datemiselocgerance = datemiselocgerance;
        }
     
        public String getDescriptionactivite() {
            return this.descriptionactivite;
        }
     
        public void setDescriptionactivite(String descriptionactivite) {
            this.descriptionactivite = descriptionactivite;
        }
     
        public short getPresencepersonnel() {
            return this.presencepersonnel;
        }
     
        public void setPresencepersonnel(short presencepersonnel) {
            this.presencepersonnel = presencepersonnel;
        }
     
        public short getSiegesocial() {
            return this.siegesocial;
        }
     
        public void setSiegesocial(short siegesocial) {
            this.siegesocial = siegesocial;
        }
     
        public Set<Certification> getCertifications() {
            return this.certifications;
        }
     
        public void setCertifications(Set<Certification> certifications) {
            this.certifications = certifications;
        }
    }
    puis les DAO :

    entreprise :
    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
     
    package package package.name.dao;
    // Generated 23 déc. 2010 09:20:19 by Hibernate Tools 3.1.0.beta4
     
    import java.util.Hashtable;
    import java.util.List;
     
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.hibernate.LockMode;
    import org.hibernate.Session;
    import org.hibernate.SessionFactory;
    import org.hibernate.Transaction;
    import org.hibernate.cfg.Configuration;
    import org.hibernate.criterion.Example;
     
    import package package.name.domain.Entreprise;
     
     
     
    /**
     * Home object for domain model class Entreprise.
     * @see package package.name.domain.Entreprise
     * @author Hibernate Tools
     */
    public class EntrepriseHome {
     
        private static final Log log = LogFactory.getLog(EntrepriseHome.class);
     
        private final SessionFactory sessionFactory = getSessionFactory();
     
        public SessionFactory getSessionFactory() {
     
        	try {
        		SessionFactory sessionFactory=new Configuration().configure().buildSessionFactory();
                Hashtable env = new Hashtable();
                env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.fscontext.RefFSContextFactory");
                env.put (Context.PROVIDER_URL,"file:///tmp"); // <-- This solved my problem!
                return (SessionFactory) new InitialContext(env).lookup("hibernate/HibernateFactory");
            }
            catch (Exception e) {
                log.error("Could not locate SessionFactory in JNDI", e);
                throw new IllegalStateException("Could not locate SessionFactory in JNDI");
            }
        }
     
        public void persist(Entreprise transientInstance) {
            log.debug("persisting Entreprise instance");
            try {
                sessionFactory.getCurrentSession().persist(transientInstance);
                log.debug("persist successful");
            }
            catch (RuntimeException re) {
                log.error("persist failed", re);
                throw re;
            }
        }
     
        public void attachDirty(Entreprise instance) {
            log.debug("attaching dirty Entreprise instance");
            try {
                sessionFactory.getCurrentSession().saveOrUpdate(instance);
                log.debug("attach successful");
            }
            catch (RuntimeException re) {
                log.error("attach failed", re);
                throw re;
            }
        }
     
        public void attachClean(Entreprise instance) {
            log.debug("attaching clean Entreprise instance");
            try {
                sessionFactory.getCurrentSession().lock(instance, LockMode.NONE);
                log.debug("attach successful");
            }
            catch (RuntimeException re) {
                log.error("attach failed", re);
                throw re;
            }
        }
     
        public void delete(Entreprise persistentInstance) {
            log.debug("deleting Entreprise instance");
            try {
     
        		Session session = getSessionFactory().getCurrentSession();
        		Transaction tx = session.beginTransaction();
                session.delete(persistentInstance);
                log.debug("delete successful");
     
            }
            catch (RuntimeException re) {
                log.error("delete failed", re);
                throw re;
            }
        }
     
        public Entreprise merge(Entreprise detachedInstance) {
            log.debug("merging Entreprise instance");
            try {
                Entreprise result = (Entreprise) sessionFactory.getCurrentSession()
                        .merge(detachedInstance);
                log.debug("merge successful");
                return result;
            }
            catch (RuntimeException re) {
                log.error("merge failed", re);
                throw re;
            }
        }
     
        public Entreprise findById( package package.name.domain.EntrepriseId id) {
            log.debug("getting Entreprise instance with id: " + id);
            try {
     
        		Session session = getSessionFactory().getCurrentSession();
        		Transaction tx = session.beginTransaction();
                Entreprise instance = (Entreprise) session.get("package package.name.domain.Entreprise", id);
                if (instance==null) {
                    log.debug("get successful, no instance found");
                   System.out.println("get successful, no instance found");
                }
                else {
                    log.debug("get successful, instance found");
                    System.out.println("get successful, instance found");
                }
                return instance;
            }
            catch (RuntimeException re) {
                log.error("get failed", re);
                throw re;
            }
        }
     
     
        public List findByExample(Entreprise instance) {
            log.debug("finding Entreprise instance by example");
            try {
                List results = sessionFactory.getCurrentSession()
                        .createCriteria("package package.name.domain.Entreprise")
                        .add(Example.create(instance))
                .list();
                log.debug("find by example successful, result size: " + results.size());
                return results;
            }
            catch (RuntimeException re) {
                log.error("find by example failed", re);
                throw re;
            }
        } 
     
    }
    établissement dao
    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
     
    package package package package.name.dao;
    // Generated 23 déc. 2010 09:20:19 by Hibernate Tools 3.1.0.beta4
     
    import java.util.List;
    import javax.naming.InitialContext;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import org.hibernate.LockMode;
    import org.hibernate.SessionFactory;
    import org.hibernate.criterion.Example;
     
    import package package package.name.domain.Etablissement;
     
     
     
    /**
     * Home object for domain model class Etablissement.
     * @see package package package.name.domain.Etablissement
     * @author Hibernate Tools
     */
    public class EtablissementHome {
     
        private static final Log log = LogFactory.getLog(EtablissementHome.class);
     
        private final SessionFactory sessionFactory = getSessionFactory();
     
        protected SessionFactory getSessionFactory() {
            try {
                return (SessionFactory) new InitialContext().lookup("SessionFactory");
            }
            catch (Exception e) {
                log.error("Could not locate SessionFactory in JNDI", e);
                throw new IllegalStateException("Could not locate SessionFactory in JNDI");
            }
        }
     
        public void persist(Etablissement transientInstance) {
            log.debug("persisting Etablissement instance");
            try {
                sessionFactory.getCurrentSession().persist(transientInstance);
                log.debug("persist successful");
            }
            catch (RuntimeException re) {
                log.error("persist failed", re);
                throw re;
            }
        }
     
        public void attachDirty(Etablissement instance) {
            log.debug("attaching dirty Etablissement instance");
            try {
                sessionFactory.getCurrentSession().saveOrUpdate(instance);
                log.debug("attach successful");
            }
            catch (RuntimeException re) {
                log.error("attach failed", re);
                throw re;
            }
        }
     
        public void attachClean(Etablissement instance) {
            log.debug("attaching clean Etablissement instance");
            try {
                sessionFactory.getCurrentSession().lock(instance, LockMode.NONE);
                log.debug("attach successful");
            }
            catch (RuntimeException re) {
                log.error("attach failed", re);
                throw re;
            }
        }
     
        public void delete(Etablissement persistentInstance) {
            log.debug("deleting Etablissement instance");
            try {
                sessionFactory.getCurrentSession().delete(persistentInstance);
                log.debug("delete successful");
            }
            catch (RuntimeException re) {
                log.error("delete failed", re);
                throw re;
            }
        }
     
        public Etablissement merge(Etablissement detachedInstance) {
            log.debug("merging Etablissement instance");
            try {
                Etablissement result = (Etablissement) sessionFactory.getCurrentSession()
                        .merge(detachedInstance);
                log.debug("merge successful");
                return result;
            }
            catch (RuntimeException re) {
                log.error("merge failed", re);
                throw re;
            }
        }
     
        public Etablissement findById( package package package.name.domain.EtablissementId id) {
            log.debug("getting Etablissement instance with id: " + id);
            try {
                Etablissement instance = (Etablissement) sessionFactory.getCurrentSession()
                        .get("package package package.name.domain.Etablissement", id);
                if (instance==null) {
                    log.debug("get successful, no instance found");
                }
                else {
                    log.debug("get successful, instance found");
                }
                return instance;
            }
            catch (RuntimeException re) {
                log.error("get failed", re);
                throw re;
            }
        }
     
     
        public List findByExample(Etablissement instance) {
            log.debug("finding Etablissement instance by example");
            try {
                List results = sessionFactory.getCurrentSession()
                        .createCriteria("package package package.name.domain.Etablissement")
                        .add(Example.create(instance))
                .list();
                log.debug("find by example successful, result size: " + results.size());
                return results;
            }
            catch (RuntimeException re) {
                log.error("find by example failed", re);
                throw re;
            }
        } 
     
    }

    Finalement la classe EntrepriseId et EtablissementId sont juste la representation des clés composites :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
     
    package package.name.domain;
    // Generated 23 déc. 2010 16:15:48 by Hibernate Tools 3.1.0.beta4
     
     
     
    /**
     * EntrepriseId generated by hbm2java
     */
     
    public class EntrepriseId  implements java.io.Serializable {
     
     
        // Fields    
     
         private int acteurObjetId;
         private int objetId;
     
     
        // Constructors
     
        /** default constructor */
        public EntrepriseId() {
        }
     
     
        /** full constructor */
        public EntrepriseId(int acteurObjetId, int objetId) {
            this.acteurObjetId = acteurObjetId;
            this.objetId = objetId;
        }
     
     
     
        // Property accessors
     
        public int getActeurObjetId() {
            return this.acteurObjetId;
        }
     
        public void setActeurObjetId(int acteurObjetId) {
            this.acteurObjetId = acteurObjetId;
        }
     
        public int getObjetId() {
            return this.objetId;
        }
     
        public void setObjetId(int objetId) {
            this.objetId = objetId;
        }
     
     
     
     
       public boolean equals(Object other) {
             if ( (this == other ) ) return true;
    		 if ( (other == null ) ) return false;
    		 if ( !(other instanceof EntrepriseId) ) return false;
    		 EntrepriseId castOther = ( EntrepriseId ) other; 
     
    		 return (this.getActeurObjetId()==castOther.getActeurObjetId())
     && (this.getObjetId()==castOther.getObjetId());
       }
     
       public int hashCode() {
             int result = 17;
     
             result = 37 * result + this.getActeurObjetId();
             result = 37 * result + this.getObjetId();
             return result;
       }   
     
     
     
     
     
    }

  10. #10
    Membre habitué
    Profil pro
    Inscrit en
    Mars 2006
    Messages
    188
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mars 2006
    Messages : 188
    Points : 140
    Points
    140
    Par défaut
    Pas d'idées ?

Discussions similaires

  1. [Mapping] Foreign key yy must have same number of columns as zz
    Par golgoth9 dans le forum Hibernate
    Réponses: 2
    Dernier message: 19/12/2014, 20h54
  2. Réponses: 3
    Dernier message: 04/02/2014, 08h49
  3. Problème de mapping Foreign key one-to-one
    Par chady dans le forum Hibernate
    Réponses: 3
    Dernier message: 20/06/2010, 23h35
  4. Réponses: 2
    Dernier message: 18/02/2010, 18h08
  5. Réponses: 2
    Dernier message: 02/04/2008, 13h21

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