List of usage examples for javax.persistence CascadeType MERGE
CascadeType MERGE
To view the source code for javax.persistence CascadeType MERGE.
Click Source Link
From source file:org.photovault.folder.PhotoFolder.java
@OneToMany(mappedBy = "parentFolder", cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE }) @org.hibernate.annotations.Sort(type = org.hibernate.annotations.SortType.COMPARATOR, comparator = PhotoFolder.PhotoFolderComparator.class) public SortedSet<PhotoFolder> getSubfolders() { return subfolders; }
From source file:org.photovault.folder.PhotoFolder.java
/** Returns the parent of this folder or null if this is a top-level folder *///from ww w . j a v a 2 s.c o m @ValueField(dtoResolver = ParentRefResolver.class, setMethod = "reparentFolder") @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE }) @JoinColumn(name = "parent_uuid", nullable = true) // This is needed since OJB set parent to 0 for the root folder. @org.hibernate.annotations.NotFound(action = org.hibernate.annotations.NotFoundAction.IGNORE) public PhotoFolder getParentFolder() { return parent; }
From source file:org.photovault.imginfo.ImageFile.java
/** * Get all images stored in this file//from w w w . j a v a2 s . c o m * @return Map that maps image location descriptor to the image descriptor object */ @MapKey(name = "locator") @OneToMany(cascade = { CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE }, mappedBy = "file") @org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE }) public Map<String, ImageDescriptorBase> getImages() { return images; }
From source file:org.photovault.imginfo.PhotoInfo.java
/** Get image descriptor for original of this photo @return original's image descriptor./*from w w w . ja v a2s .c o m*/ */ @ValueField(dtoResolver = OrigImageRefResolver.class) @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @org.hibernate.annotations.Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE }) @JoinColumn(name = "original_id", nullable = true) @org.hibernate.annotations.AccessType("field") public OriginalImageDescriptor getOriginal() { return original; }
From source file:org.projectforge.access.GroupTaskAccessDO.java
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }) @JoinColumn(name = "group_id") public GroupDO getGroup() { return group; }
From source file:org.projectforge.access.GroupTaskAccessDO.java
@ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, targetEntity = TaskDO.class) @JoinColumn(name = "task_id") public TaskDO getTask() { return task; }
From source file:org.projectforge.business.task.TaskDO.java
/** -> Gantt */ @Deprecated/*from w w w . ja v a2s.c om*/ @ManyToOne(cascade = { CascadeType.PERSIST, CascadeType.MERGE }, targetEntity = TaskDO.class) @JoinColumn(name = "gantt_predecessor_fk") public TaskDO getGanttPredecessor() { return ganttPredecessor; }
From source file:org.projectforge.continuousdb.demo.entities.GroupDO.java
@ManyToMany(targetEntity = UserDO.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<UserDO> getAssignedUsers() { return assignedUsers; }
From source file:org.projectforge.framework.persistence.user.entities.GroupDO.java
@ManyToMany(targetEntity = org.projectforge.framework.persistence.user.entities.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"), indexes = { @javax.persistence.Index(name = "idx_fk_t_group_user_group_id", columnList = "group_id"), @javax.persistence.Index(name = "idx_fk_t_group_user_user_id", columnList = "user_id") }) public Set<PFUserDO> getAssignedUsers() { return assignedUsers; }
From source file:org.projectforge.user.GroupDO.java
@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; }