Java Code Examples for javax.persistence.CascadeType#PERSIST

The following examples show how to use javax.persistence.CascadeType#PERSIST . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SCCSubscription.java    From uyuni with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Get the SUSE Products
 * @return the SUSE Products
 */
@ManyToMany(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@JoinTable(name = "suseSCCSubscriptionProduct",
    joinColumns = @JoinColumn(name = "subscription_id"),
    inverseJoinColumns = @JoinColumn(name = "product_id"))
public Set<SUSEProduct> getProducts() {
    return products;
}
 
Example 2
Source File: Media.java    From aws-photosharing-example with Apache License 2.0 5 votes vote down vote up
@ManyToMany(fetch=FetchType.LAZY, cascade=CascadeType.PERSIST)
@JoinTable(name = "album_media", 
		   joinColumns = { 
		@JoinColumn(name = "media_id", nullable = false, updatable = false) }, 
inverseJoinColumns = { 
		@JoinColumn(name = "album_id", nullable = false, updatable = false) })    
public List<Album> getAlbums() {return albums;}
 
Example 3
Source File: Race.java    From pikatimer with GNU General Public License v3.0 5 votes vote down vote up
@OneToMany(mappedBy="race",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.EAGER)
@OrderBy("split_seq_number")
@Fetch(FetchMode.SELECT)
public List<Split> getSplits() {
    return raceSplitList;
    //return raceSplits.sorted((Split o1, Split o2) -> o1.getPosition().compareTo(o2.getPosition()));
}
 
Example 4
Source File: Person.java    From requery with Apache License 2.0 4 votes vote down vote up
@OneToOne(cascade = CascadeType.PERSIST)
@JoinColumn(foreignKey = @ForeignKey)
Address getAddress();
 
Example 5
Source File: ExamPaper.java    From Exam-Online with Apache License 2.0 4 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, cascade=CascadeType.PERSIST)
@JoinTable(name="exampaper_question")
@OrderBy("type")
public List<Question> getQuestions() {
	return questions;
}
 
Example 6
Source File: GroupTaskAccessDO.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE})
@JoinColumn(name = "group_id")
public GroupDO getGroup()
{
  return group;
}
 
Example 7
Source File: Person.java    From requery with Apache License 2.0 4 votes vote down vote up
@OneToMany(mappedBy = "owner", cascade =
        {CascadeType.REMOVE, CascadeType.PERSIST})
MutableResult<Phone> getPhoneNumbers();
 
Example 8
Source File: Role.java    From zxl with Apache License 2.0 4 votes vote down vote up
@ManyToMany(targetEntity = User.class, mappedBy = "roles", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JsonIgnore
@XmlTransient
public Set<User> getUsers() {
	return users;
}
 
Example 9
Source File: PhoneBookEntry.java    From livingdoc-core with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "PHONEBOOK_ID")
public PhoneBook getPhoneBook() {
    return phoneBook;
}
 
Example 10
Source File: Control.java    From zxl with Apache License 2.0 4 votes vote down vote up
@ManyToMany(fetch = FetchType.EAGER, targetEntity = Role.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JsonIgnore
@XmlTransient
public Set<Role> getRoles() {
	return roles;
}
 
Example 11
Source File: Reference.java    From livingdoc-core with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinColumn(name = "LAST_EXECUTION_ID")
public Execution getLastExecution() {
    return lastExecution;
}
 
Example 12
Source File: User.java    From MiniWeChat-Server with MIT License 4 votes vote down vote up
@ManyToMany(targetEntity = Group.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "group_members", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "group_id"))
   public List<Group> getGroups() {
	return groups;
}
 
Example 13
Source File: Resource.java    From zxl with Apache License 2.0 4 votes vote down vote up
@ManyToMany(fetch = FetchType.EAGER, targetEntity = Role.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JsonIgnore
@XmlTransient
public Set<Role> getRoles() {
	return roles;
}
 
Example 14
Source File: Reference.java    From livingdoc-core with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.ALL })
@JoinColumn(name = "REQUIREMENT_ID")
public Requirement getRequirement() {
    return requirement;
}
 
Example 15
Source File: GroupTaskAccessDO.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE}, targetEntity = TaskDO.class)
@JoinColumn(name = "task_id")
public TaskDO getTask()
{
  return task;
}
 
Example 16
Source File: RaceReport.java    From pikatimer with GNU General Public License v3.0 4 votes vote down vote up
@OneToMany(mappedBy="raceReport",cascade={CascadeType.PERSIST, CascadeType.REMOVE},fetch = FetchType.LAZY)
@Fetch(FetchMode.SELECT)
public List<RaceOutputTarget> getRaceOutputTargets() {
    return raceOutputTargetList;
}
 
Example 17
Source File: User.java    From zxl with Apache License 2.0 4 votes vote down vote up
@ManyToMany(fetch = FetchType.LAZY, targetEntity = Role.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JsonIgnore
@XmlTransient
public Set<Role> getRoles() {
	return roles;
}
 
Example 18
Source File: GroupDO.java    From projectforge-webapp with GNU General Public License v3.0 4 votes vote down vote up
@ManyToMany(targetEntity = org.projectforge.user.PFUserDO.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER)
@JoinTable(name = "T_GROUP_USER", joinColumns = @JoinColumn(name = "GROUP_ID"), inverseJoinColumns = @JoinColumn(name = "USER_ID"))
public Set<PFUserDO> getAssignedUsers()
{
  return assignedUsers;
}
 
Example 19
Source File: Group.java    From MiniWeChat-Server with MIT License 4 votes vote down vote up
@ManyToMany(targetEntity = User.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JoinTable(name = "group_members", joinColumns = @JoinColumn(name = "group_id"), inverseJoinColumns = @JoinColumn(name = "user_id"))
public List<User> getMemberList() {
	return memberList;
}
 
Example 20
Source File: Role.java    From zxl with Apache License 2.0 4 votes vote down vote up
@ManyToMany(mappedBy = "roles", targetEntity = Resource.class, cascade = { CascadeType.PERSIST, CascadeType.MERGE })
@JsonIgnore
@XmlTransient
public Set<Resource> getResources() {
	return resources;
}