@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'MeasurementOrFact'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
@Cascade(CascadeType.ALL) @OneToMany(mappedBy = "taskData") @OnDelete(action = OnDeleteAction.CASCADE) public List<EnvironmentModifierData> getEnvModifiers() { return envModifiers; }
@Override @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Identification'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) public Set<Annotation> getAnnotations() { return annotations; }
/** * @return the annotations */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Distribution'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
private static EnumSet<CascadeType> convertToHibernateCascadeType(javax.persistence.CascadeType[] ejbCascades) { EnumSet<CascadeType> hibernateCascadeSet = EnumSet.noneOf( CascadeType.class ); if ( ejbCascades != null && ejbCascades.length > 0 ) { for ( javax.persistence.CascadeType cascade : ejbCascades ) { switch ( cascade ) { case ALL: hibernateCascadeSet.add( CascadeType.ALL ); break; case PERSIST: hibernateCascadeSet.add( CascadeType.PERSIST ); break; case MERGE: hibernateCascadeSet.add( CascadeType.MERGE ); break; case REMOVE: hibernateCascadeSet.add( CascadeType.REMOVE ); break; case REFRESH: hibernateCascadeSet.add( CascadeType.REFRESH ); break; case DETACH: hibernateCascadeSet.add( CascadeType.DETACH ); break; } } } return hibernateCascadeSet; }
private void cascadeSave(UniqueId<Long> entity) throws Exception { for (Field field : entity.getClass().getDeclaredFields()) { if (isLongUniqueId(field.getType()) && isCascade(field, CascadeType.SAVE_UPDATE)) { field.setAccessible(true); @SuppressWarnings("unchecked") UniqueId<Long> fieldValue = (UniqueId<Long>) field.get(entity); if (fieldValue != null) { assignId(fieldValue); } } } }
@SuppressWarnings("deprecation") @ManyToOne(optional=true) @JoinColumn(name="expedient_tipus") @ForeignKey(name="hel_exptipus_seqdefany_fk") @Cascade({CascadeType.DELETE_ORPHAN}) public ExpedientTipus getExpedientTipus() { return expedientTipus; }
/** * @return the annotations */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Description'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
@OneToMany(fetch=FetchType.LAZY) @Cascade({ CascadeType.PERSIST , CascadeType.MERGE , CascadeType.REFRESH , CascadeType.SAVE_UPDATE , CascadeType.DETACH }) @JoinTable(name = "FRAGMENT2FRAGMENT", joinColumns = @JoinColumn(name = "from_id"), inverseJoinColumns = @JoinColumn(name = "to_id")) public Set<Fragment> getRelatedOnes() { return relatedOnes; }
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "Taxon_TypeAndSpecimen", joinColumns = {@JoinColumn(name = "typesAndSpecimens_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getTaxa() { return taxa; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'TypeAndSpecimen'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "Taxon_IdentificationKey", joinColumns = {@JoinColumn(name = "keys_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getTaxa() { return taxa; }
/** * @return the comments */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'IdentificationKey'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Place'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
/** * The list of all taxa associated with this reference. * * @return a set of taxa */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "Taxon_Reference", joinColumns = {@JoinColumn(name = "references_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getTaxa() { return taxa; }
/** * @return the annotations */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Reference'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
/** * @return the annotations */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Identifier'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "Taxon_Concept", joinColumns = {@JoinColumn(name = "concepts_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getTaxa() { return taxa; }
/** * @return the comments */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'Concept'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
@OneToMany(fetch=FetchType.LAZY) @Cascade({ CascadeType.PERSIST , CascadeType.MERGE , CascadeType.REFRESH , CascadeType.SAVE_UPDATE , CascadeType.DETACH }) @JoinTable(name = "TAG2FRAGMENT", joinColumns = @JoinColumn(name = "fragment_id"), inverseJoinColumns = @JoinColumn(name = "tag_id")) public Set<Tag> getTags() { return this.tags; }
/** * @return the references */ @ManyToMany(fetch = FetchType.LAZY) @Cascade({ CascadeType.SAVE_UPDATE }) @JoinTable(name = "Distribution_Reference", joinColumns = { @JoinColumn(name = "Distribution_id") }, inverseJoinColumns = { @JoinColumn(name = "references_id") }) @JsonSerialize(contentUsing = ReferenceSerializer.class) public Set<Reference> getReferences() { return references; }
@Override @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'PhylogeneticTree'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
@Override @ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "Taxon_PhylogeneticTree", joinColumns = {@JoinColumn(name = "trees_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getTaxa() { return taxa; }
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "PhylogeneticTree_Taxon", joinColumns = {@JoinColumn(name = "PhylogeneticTree_id")}, inverseJoinColumns = {@JoinColumn(name = "leaves_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getLeaves() { return leaves; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'PhylogeneticTree'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
/** * * @return the groups this user is a member of */ @ManyToMany(fetch = FetchType.LAZY) @Cascade({CascadeType.SAVE_UPDATE}) @JoinTable( name = "User_Group", joinColumns = { @JoinColumn(name = "User_id") }, inverseJoinColumns = { @JoinColumn(name = "groups_id") }) @JsonSerialize(contentUsing = GroupSerializer.class) public Set<Group> getGroups() { return groups; }
@ManyToMany(fetch = FetchType.LAZY) @JoinTable(name = "Taxon_Image", joinColumns = {@JoinColumn(name = "images_id")}, inverseJoinColumns = {@JoinColumn(name = "Taxon_id")}) @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE }) @JsonSerialize(contentUsing = TaxonSerializer.class) public Set<Taxon> getTaxa() { return taxa; }
@Override @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Image'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "commentPage_id") @OrderBy("created DESC") @Where(clause = "commentPage_type = 'Image'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public List<Comment> getComments() { return comments; }
@Override @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'VernacularName'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
/** * @return the jobs */ @JsonIgnore @OneToMany(fetch = FetchType.LAZY, mappedBy = "organisation") @Cascade(CascadeType.DELETE) @OrderBy("lastHarvested DESC") public Set<Resource> getResources() { return resources; }
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Organisation'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
/** * @return a map of descriptions about the taxon */ @OneToMany(fetch = FetchType.LAZY, mappedBy = "taxon", orphanRemoval = true) @Cascade({ CascadeType.ALL }) @JsonManagedReference("descriptions-taxon") public Set<Description> getDescriptions() { return descriptions; }
/** * @return the immediate taxonomic parent */ @ManyToOne(fetch = FetchType.LAZY) @Cascade({ CascadeType.SAVE_UPDATE }) @JsonSerialize(using = TaxonSerializer.class) public Taxon getParentNameUsage() { return parentNameUsage; }
/** * @return get the accepted name of this synonym */ @ManyToOne(fetch = FetchType.LAZY) @Cascade({ CascadeType.SAVE_UPDATE }) @JsonSerialize(using = TaxonSerializer.class) public Taxon getAcceptedNameUsage() { return acceptedNameUsage; }
/** * @return the distribution associated with this taxon */ @OneToMany(fetch = FetchType.LAZY, mappedBy = "taxon", orphanRemoval = true) @Cascade({ CascadeType.ALL }) @JsonManagedReference("distribution-taxon") public Set<Distribution> getDistribution() { return distribution; }
/** * @return the annotations */ @OneToMany(fetch = FetchType.LAZY, orphanRemoval = true) @JoinColumn(name = "annotatedObjId") @Where(clause = "annotatedObjType = 'Taxon'") @Cascade({ CascadeType.SAVE_UPDATE, CascadeType.MERGE, CascadeType.DELETE }) @JsonIgnore public Set<Annotation> getAnnotations() { return annotations; }
/** * @return the protologue */ @ManyToOne(fetch = FetchType.LAZY) @Cascade({ CascadeType.SAVE_UPDATE }) @JsonSerialize(using = ReferenceSerializer.class) public Reference getNamePublishedIn() { return namePublishedIn; }
@OneToMany(fetch=FetchType.LAZY) @Cascade({CascadeType.MERGE , CascadeType.REFRESH , CascadeType.SAVE_UPDATE , CascadeType.DETACH }) @JoinTable(name = "TAG2FRAGMENT", joinColumns = @JoinColumn(name = "tag_id"), inverseJoinColumns = @JoinColumn(name = "fragment_id")) public Set<Fragment> getFragments() { return this.fragments; }
/** * @return the originalNameUsage */ @ManyToOne(fetch = FetchType.LAZY) @Cascade({ CascadeType.SAVE_UPDATE }) @JsonSerialize(using = TaxonSerializer.class) public Taxon getOriginalNameUsage() { return originalNameUsage; }