private static void bindFilters(XAnnotatedElement annotatedElement, EntityBinder entityBinder) { Filters filtersAnn = annotatedElement.getAnnotation( Filters.class ); if ( filtersAnn != null ) { for ( Filter filter : filtersAnn.value() ) { entityBinder.addFilter(filter); } } Filter filterAnn = annotatedElement.getAnnotation( Filter.class ); if ( filterAnn != null ) { entityBinder.addFilter(filterAnn); } }
@OneToMany(mappedBy = "authorization") @Filters({@Filter(name = "limitByNotDeleted")}) @JsonManagedReference public List<UserAuthorization> getUserAuthorizations() { if (userAuthorizations == null) { userAuthorizations = new LinkedList<UserAuthorization>(); } return userAuthorizations; }
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, mappedBy = "user") @Filters({@Filter(name = "limitByNotDeleted")}) public List<UserAuthorization> getUserAuthorizations() { if (userAuthorizations == null) { userAuthorizations = new LinkedList<UserAuthorization>(); } return userAuthorizations; }
/** * Gets all the files. * * @return the files */ @OneToMany(mappedBy = "project", fetch = FetchType.LAZY, cascade = CascadeType.ALL) @Sort(type = SortType.NATURAL) @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.FILES_FILTER) public SortedSet<CaArrayFile> getFiles() { return this.files; }
/** * Gets the files. * * @return the files */ @OneToMany(mappedBy = "project", fetch = FetchType.LAZY) @Sort(type = SortType.NATURAL) @Where(clause = "(status = 'IMPORTED' or status = 'IMPORTED_NOT_PARSED')") @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.FILES_FILTER) private SortedSet<CaArrayFile> getImportedFileSet() { return this.importedFiles; }
/** * Gets the files. * * @return the files */ @OneToMany(mappedBy = "project", fetch = FetchType.LAZY) @Sort(type = SortType.NATURAL) @Where(clause = "status = 'IMPORTING'") @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.FILES_FILTER) private SortedSet<CaArrayFile> getImportingFileSet() { return this.importingFiles; }
/** * Gets the files. * * @return the files */ @OneToMany(mappedBy = "project", fetch = FetchType.LAZY) @Sort(type = SortType.NATURAL) @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = "status = 'SUPPLEMENTAL' and " + Experiment.FILES_FILTER) private SortedSet<CaArrayFile> getSupplementalFileSet() { return this.supplementalFiles; }
/** * Gets the files. * * @return the files */ @OneToMany(mappedBy = "project", fetch = FetchType.LAZY) @Sort(type = SortType.NATURAL) @Where(clause = "status != 'IMPORTED' and status != 'IMPORTED_NOT_PARSED' and status != 'SUPPLEMENTAL'") @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.FILES_FILTER) private SortedSet<CaArrayFile> getUnImportedFileSet() { return this.unImportedFiles; }
/** * Gets the samples. * * @return the samples */ @OneToMany(mappedBy = "experiment", targetEntity = AbstractBioMaterial.class, fetch = FetchType.LAZY) @Filters({ @Filter(name = BIOMATERIAL_FILTER_NAME, condition = "discriminator = '" + Sample.DISCRIMINATOR + "'"), @Filter(name = SECURITY_FILTER_NAME, condition = SAMPLES_FILTER) } ) @Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) public Set<Sample> getSamples() { return this.samples; }
/** * Gets the extracts. * * @return the extracts */ @OneToMany(mappedBy = "experiment", targetEntity = AbstractBioMaterial.class, fetch = FetchType.LAZY) @Where(clause = "discriminator = '" + Extract.DISCRIMINATOR + "'") @Filter(name = SECURITY_FILTER_NAME, condition = EXTRACTS_FILTER) @Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) public Set<Extract> getExtracts() { return this.extracts; }
/** * Gets the labeledExtracts. * * @return the labeledExtracts */ @OneToMany(mappedBy = "experiment", targetEntity = AbstractBioMaterial.class, fetch = FetchType.LAZY) @Where(clause = "discriminator = '" + LabeledExtract.DISCRIMINATOR + "'") @Filter(name = SECURITY_FILTER_NAME, condition = LABELED_EXTRACTS_FILTER) @Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) public Set<LabeledExtract> getLabeledExtracts() { return this.labeledExtracts; }
/** * @return hybridizations */ @OneToMany(fetch = FetchType.LAZY) @JoinColumn(name = EXPERIMENT_REF) @ForeignKey(name = "hybridization_expr_fk") @Cascade({ org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.DELETE, org.hibernate.annotations.CascadeType.DELETE_ORPHAN }) @Filter(name = SECURITY_FILTER_NAME, condition = HYBRIDIZATIONS_FILTER) public Set<Hybridization> getHybridizations() { return this.hybridizations; }
/** * Gets the samples. * * @return the samples */ @ManyToMany(fetch = FetchType.LAZY) @JoinTable( name = "sourcesample", joinColumns = { @javax.persistence.JoinColumn(name = DEFAULT_FK_ID) }, inverseJoinColumns = { @javax.persistence.JoinColumn(name = "sample_id") } ) @ForeignKey(name = "sourcesample_source_fk", inverseName = "sourcesample_sample_fk") @Cascade(org.hibernate.annotations.CascadeType.SAVE_UPDATE) @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.SAMPLES_FILTER) public Set<Sample> getSamples() { return samples; }
private String getCondition(Filter filter) { //set filtering String name = filter.name(); String cond = filter.condition(); return getCondition( cond, name ); }
public void addFilter(Filter filter) { filters.add(filter); }
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) @MapKey(name = "name") @Filters({@Filter(name = "limitByNotDeleted")}) public Map<String, Attribute> getUserAttributes() { return userAttributes; }
/** * Gets the extracts. * * @return the extracts */ @ManyToMany(mappedBy = "labeledExtracts") @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.EXTRACTS_FILTER) public Set<Extract> getExtracts() { return extracts; }
/** * Gets the samples. * * @return the samples */ @ManyToMany(mappedBy = "extracts") @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.SAMPLES_FILTER) public Set<Sample> getSamples() { return samples; }
/** * Gets the labeledExtract. * * @return the labeledExtract */ @ManyToMany(mappedBy = "hybridizations", fetch = FetchType.LAZY) @Filter(name = Experiment.SECURITY_FILTER_NAME, condition = Experiment.LABELED_EXTRACTS_FILTER) public Set<LabeledExtract> getLabeledExtracts() { return this.labeledExtract; }
/** * Gets all the biomaterials (e.g. union of sources, samples, extracts, labeled extracts). * This is currently private, as it is only used in hibernate queries. If in the future * client code needs to access it, a wrapper method should be added that wraps this in * an unmodifiable set, to assure that modifications are only made to the underlying * source, sample, etc, collection. * * @return the biomaterials */ @OneToMany(mappedBy = "experiment", fetch = FetchType.LAZY) @Filter(name = SECURITY_FILTER_NAME, condition = BIOMATERIALS_ALIAS_FILTER) @SuppressWarnings({"unused", "PMD.UnusedPrivateMethod" }) private Set<AbstractBioMaterial> getBiomaterials() { return this.biomaterials; }