Java 类org.hibernate.annotations.Filter 实例源码

项目:lams    文件:AnnotationBinder.java   
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);
        }
    }
项目:caratarse-auth    文件:Authorization.java   
@OneToMany(mappedBy = "authorization")
@Filters({@Filter(name = "limitByNotDeleted")})
@JsonManagedReference
public List<UserAuthorization> getUserAuthorizations() {
    if (userAuthorizations == null) {
        userAuthorizations = new LinkedList<UserAuthorization>();
    }
    return userAuthorizations;
}
项目:caratarse-auth    文件:User.java   
@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;
}
项目:caarray    文件:Project.java   
/**
 * 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;
}
项目:caarray    文件:Project.java   
/**
 * 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;
}
项目:caarray    文件:Project.java   
/**
 * 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;
}
项目:caarray    文件:Project.java   
/**
 * 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;
}
项目:caarray    文件:Project.java   
/**
 * 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;
}
项目:caarray    文件:Experiment.java   
/**
 * 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;
}
项目:caarray    文件:Experiment.java   
/**
 * 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;
}
项目:caarray    文件:Experiment.java   
/**
 * 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;
}
项目:caarray    文件:Experiment.java   
/**
 * @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;
}
项目:caarray    文件:Source.java   
/**
 * 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;
}
项目:lams    文件:CollectionBinder.java   
private String getCondition(Filter filter) {
    //set filtering
    String name = filter.name();
    String cond = filter.condition();
    return getCondition( cond, name );
}
项目:lams    文件:EntityBinder.java   
public void addFilter(Filter filter) {
    filters.add(filter);
}
项目:caratarse-auth    文件:User.java   
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@MapKey(name = "name")
@Filters({@Filter(name = "limitByNotDeleted")})
public Map<String, Attribute> getUserAttributes() {
    return userAttributes;
}
项目:caarray    文件:LabeledExtract.java   
/**
 * 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;
}
项目:caarray    文件:Extract.java   
/**
 * 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;
}
项目:caarray    文件:Hybridization.java   
/**
 * 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;
}
项目:caarray    文件:Experiment.java   
/**
 * 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;
}