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 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; }
@OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) @MapKey(name = "name") @Filters({@Filter(name = "limitByNotDeleted")}) public Map<String, Attribute> getUserAttributes() { return userAttributes; }