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

项目: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    文件: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;
}
项目:caratarse-auth    文件:User.java   
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE})
@MapKey(name = "name")
@Filters({@Filter(name = "limitByNotDeleted")})
public Map<String, Attribute> getUserAttributes() {
    return userAttributes;
}