-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to save Entity without saving mapped object (child)?
PostPosted: Fri Jan 28, 2011 5:34 pm 
Newbie

Joined: Fri Jan 28, 2011 5:20 pm
Posts: 1
New to Hibernate.

For example:
@Entity
@Table(name = "baseline")
public class Baseline implements Serializable {
private Integer id;

@Id
public Integer getId() {
return id;
}

public void setId(Integer id) {
this.id = id;
}

private Family family;

@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "family_id)
public Family getFamily() {
return family;
}
public void setFamily(Familyfamily) {
this.family= family;
}
}


Is there any annotation to tell the Hibernate that the property Family does not need to be saved when save Baseline?

Thanks!!


Top
 Profile  
 
 Post subject: Re: How to save Entity without saving mapped object (child)?
PostPosted: Mon Jan 31, 2011 4:50 am 
Regular
Regular

Joined: Fri Jan 28, 2011 11:44 am
Posts: 117
Take a look at the cascade property, it should answer your question


Top
 Profile  
 
 Post subject: Re: How to save Entity without saving mapped object (child)?
PostPosted: Tue Feb 01, 2011 8:38 am 
Newbie

Joined: Wed Jan 26, 2011 12:32 pm
Posts: 12
overmeulen wrote:
Take a look at the cascade property, it should answer your question

I believe he has to look into INVERSE flag along with cascade


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

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.