-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: org.hibernate.PropertyValueException
PostPosted: Thu Jul 14, 2011 5:20 am 
Newbie

Joined: Thu Jul 14, 2011 5:12 am
Posts: 1
Hi,

ich habe folgende Pojos:

Code:
public class ParticipantPojo implements Serializable
    .....
    @OneToMany(mappedBy = "participant", cascade = CascadeType.ALL)
    private Set<ParticipantIdentificationNumberPojo> identificationNumbers;


Code:
public class ParticipantIdentificationNumberPojo implements Serializable
     ......
    @ManyToOne
    @JoinColumn(name = "PARTICIPANT", nullable = false)
    private ParticipantPojo participant;



Nun würde ich gerne einen neuen Participant speichern:
Code:
        ParticipantPojo pojo= new ParticipantPojo ();
        ...
        Set<ParticipantIdentificationNumberPojo> identSet = new HashSet<ParticipantIdentificationNumberPojo>();
        ParticipantIdentificationNumberPojo ident= new ParticipantIdentificationNumberPojo();
        ....ident befüllen
        identInfosSet.add(identInfo);



Wenn ich das ganze jedoch mit
Code:
session.save(pojo);

speicher möchte, erhalte ich folgende Exception:
Code:
org.hibernate.PropertyValueException: not-null property references a null or transient value: de.seeburger.marktpartnerdaten.database.pojo.ParticipantIdentificationNumberPojo.participant


Wo ist der Fehler in meinem Code? Anscheinend speichert Hibernate momentan nicht zuerst den Participant um dessen Info dann in ParticipantIdentificationNumber zu hinterlegen :-(


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.