private List<Property<Serializable>> getStoredProperties() throws InstantiationException, IllegalAccessException, ClassNotFoundException { CredentialStorage credentialStorage = (CredentialStorage) Class.forName(getType()).newInstance(); PropertyQuery<Serializable> query = PropertyQueries.createQuery(credentialStorage.getClass()); query.addCriteria(new AnnotatedPropertyCriteria(Stored.class)); return query.getResultList(); } }
private synchronized void queryIdProperties(Class<?> resourceClass) { if (!idProperties.containsKey(resourceClass)) { List<Property<Serializable>> props = PropertyQueries.<Serializable>createQuery(resourceClass) .addCriteria(new AnnotatedPropertyCriteria(idAnnotationClass)) .getResultList(); // If there is more than one property sort them in ascending alphabetical order if (props.size() > 1) { Collections.sort(props, new Comparator<Property<Serializable>>() { @Override public int compare(Property<Serializable> a, Property<Serializable> b) { return a.getName().compareTo(b.getName()); } }); } idProperties.put(resourceClass, props); } }
private synchronized void queryIdProperties(Class<?> resourceClass) { if (!idProperties.containsKey(resourceClass)) { List<Property<Serializable>> props = PropertyQueries.<Serializable>createQuery(resourceClass) .addCriteria(new AnnotatedPropertyCriteria(idAnnotationClass)) .getResultList(); // If there is more than one property sort them in ascending alphabetical order if (props.size() > 1) { Collections.sort(props, new Comparator<Property<Serializable>>() { @Override public int compare(Property<Serializable> a, Property<Serializable> b) { return a.getName().compareTo(b.getName()); } }); } idProperties.put(resourceClass, props); } }
private List<Property<Serializable>> getStoredProperties() throws InstantiationException, IllegalAccessException, ClassNotFoundException { CredentialStorage credentialStorage = (CredentialStorage) Class.forName(getType()).newInstance(); PropertyQuery<Serializable> query = PropertyQueries.createQuery(credentialStorage.getClass()); query.addCriteria(new AnnotatedPropertyCriteria(Stored.class)); return query.getResultList(); } }
private List<Property<Serializable>> getAttributedProperties(T attributedType) { PropertyQuery<Serializable> query = PropertyQueries.createQuery(attributedType.getClass()); query.addCriteria(new AnnotatedPropertyCriteria(AttributeProperty.class)); return query.getResultList(); }
private List<Property<Serializable>> getAttributedProperties(T attributedType) { PropertyQuery<Serializable> query = PropertyQueries.createQuery(attributedType.getClass()); query.addCriteria(new AnnotatedPropertyCriteria(AttributeProperty.class)); return query.getResultList(); }
protected List<Property<String>> getAnnotatedProperties(Class<? extends Annotation> annotationType, Class<?> type) { return PropertyQueries.<String>createQuery(type) .addCriteria(new AnnotatedPropertyCriteria(annotationType)) .getResultList(); }
@Override public boolean supports(Class<?> entityType) { return PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipDescriptor.class)) .getFirstResult() != null && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipMember.class)) .getFirstResult() != null; }
@Override public boolean supports(Class<?> entityType) { return PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipClass.class)) .getFirstResult() != null; }
@Override public boolean supports(Class<?> entityType) { return PropertyQueries .createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(PartitionClass.class)) .getFirstResult() != null; }
@Override public boolean supports(Class<?> entityType) { return !PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(AttributeValue.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(AttributeClass.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(IdentityClass.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(PartitionClass.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipClass.class)) .getResultList().isEmpty(); }
@Override public boolean supports(Class<?> entityType) { return PropertyQueries .createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(PartitionClass.class)) .getFirstResult() != null; }
protected Property getAnnotatedProperty(Class<? extends Annotation> annotationType, Class<?> type) { return PropertyQueries.<String>createQuery(type) .addCriteria(new AnnotatedPropertyCriteria(annotationType)) .getFirstResult(); }
protected List<Property<String>> getAnnotatedProperties(Class<? extends Annotation> annotationType, Class<?> type) { return PropertyQueries.<String>createQuery(type) .addCriteria(new AnnotatedPropertyCriteria(annotationType)) .getResultList(); }
protected Property getAnnotatedProperty(Class<? extends Annotation> annotationType, Class<?> type) { return PropertyQueries.<String>createQuery(type) .addCriteria(new AnnotatedPropertyCriteria(annotationType)) .getFirstResult(); }
@Override public boolean supports(Class<?> entityType) { return PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipClass.class)) .getFirstResult() != null; }
@Override public boolean supports(Class<?> entityType) { return PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipDescriptor.class)) .getFirstResult() != null && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipMember.class)) .getFirstResult() != null; }
@Override public boolean supports(Class<?> entityType) { return !PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(AttributeValue.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(AttributeClass.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(IdentityClass.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(PartitionClass.class)) .getResultList().isEmpty() && PropertyQueries.<String>createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(RelationshipClass.class)) .getResultList().isEmpty(); }
@Override public boolean supports(Class<?> entityType) { if (entityType.isAnnotationPresent(IdentityManaged.class)) { Property<Object> result = PropertyQueries.createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(IdentityClass.class)).getFirstResult(); if (result != null) { if (!result.getJavaClass().equals(String.class)) { throw new SecurityConfigurationException("IdentityType entities should be mapped with String valued @IdentityClass property."); } return true; } } return false; }
@Override public boolean supports(Class<?> entityType) { if (entityType.isAnnotationPresent(IdentityManaged.class)) { Property<Object> result = PropertyQueries.createQuery(entityType) .addCriteria(new AnnotatedPropertyCriteria(IdentityClass.class)).getFirstResult(); if (result != null) { if (!result.getJavaClass().equals(String.class)) { throw new SecurityConfigurationException("IdentityType entities should be mapped with String valued @IdentityClass property."); } return true; } } return false; }