/** * Get the result from the query, causing the query to be run. * * @return the results, or an empty list if there are no results */ public List<Property<V>> getResultList() { return getResultList(false); }
/** * Get the result from the query, causing the query to be run. * * @return the results, or an empty list if there are no results */ public List<Property<V>> getResultList() { return getResultList(false); }
/** * Get the result from the query, causing the query to be run. * * @return the results, or an empty list if there are no results */ public List<Property<V>> getResultList() { return getResultList(false); }
/** * Get the non read only results from the query, causing the query to be run. * * @return the results, or an empty list if there are no results */ public List<Property<V>> getWritableResultList() { return getResultList(true); }
/** * Get the non read only results from the query, causing the query to be run. * * @return the results, or an empty list if there are no results */ public List<Property<V>> getWritableResultList() { return getResultList(true); }
/** * Get the first result from the query, causing the query to be run. * * @return the first result, or null if there are no results */ public Property<V> getFirstResult() { List<Property<V>> results = getResultList(); return results.isEmpty() ? null : results.get(0); }
/** * Get the first result from the query, causing the query to be run. * * @return the first result, or null if there are no results */ public Property<V> getFirstResult() { List<Property<V>> results = getResultList(); return results.isEmpty() ? null : results.get(0); }
/** * Get the first result from the query, causing the query to be run. * * @return the first result, or null if there are no results */ public Property<V> getFirstResult() { List<Property<V>> results = getResultList(); return results.isEmpty() ? null : results.get(0); }
private Set<Property<? extends IdentityType>> queryRelationshipIdentityProperties(Class<? extends Relationship> relationshipClass) { PropertyQuery<? extends IdentityType> query = PropertyQueries.createQuery(relationshipClass); query.addCriteria(new TypedPropertyCriteria(IdentityType.class, MatchOption.SUB_TYPE)); Set<Property<? extends IdentityType>> properties = new HashSet<Property<? extends IdentityType>>(); for (Property<? extends IdentityType> prop : query.getResultList()) { properties.add(prop); } return Collections.unmodifiableSet(properties); } }
private Set<Property<? extends IdentityType>> queryRelationshipIdentityProperties(Class<? extends Relationship> relationshipClass) { PropertyQuery<? extends IdentityType> query = PropertyQueries.createQuery(relationshipClass); query.addCriteria(new TypedPropertyCriteria(IdentityType.class, MatchOption.SUB_TYPE)); Set<Property<? extends IdentityType>> properties = new HashSet<Property<? extends IdentityType>>(); for (Property<? extends IdentityType> prop : query.getResultList()) { properties.add(prop); } return Collections.unmodifiableSet(properties); } }
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>> 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 protected Relationship doPopulateEntry(Map<String, Serializable> properties) throws Exception { Relationship relationship = super.doPopulateEntry(properties); List<Property<Serializable>> relationshipAttributeTypes = PropertyQueries .<Serializable> createQuery(relationship.getClass()) .addCriteria(new AnnotatedPropertyCriteria(AttributeProperty.class)).getResultList(); for (Property<Serializable> property : relationshipAttributeTypes) { property.setValue(relationship, properties.get(property.getName())); } return relationship; }
@Override protected Relationship doPopulateEntry(Map<String, Serializable> properties) throws Exception { Relationship relationship = super.doPopulateEntry(properties); List<Property<Serializable>> relationshipAttributeTypes = PropertyQueries .<Serializable> createQuery(relationship.getClass()) .addCriteria(new AnnotatedPropertyCriteria(AttributeProperty.class)).getResultList(); for (Property<Serializable> property : relationshipAttributeTypes) { property.setValue(relationship, properties.get(property.getName())); } return relationship; }
protected Property getDefaultLoginNameProperty(Class<? extends Account> accountType) { List<Property<Object>> properties = PropertyQueries .createQuery(accountType) .addCriteria(new AnnotatedPropertyCriteria(StereotypeProperty.class)).getResultList(); for (Property property : properties) { StereotypeProperty stereotypeProperty = property.getAnnotatedElement().getAnnotation(StereotypeProperty.class); if (StereotypeProperty.Property.IDENTITY_USER_NAME.equals(stereotypeProperty.value())) { return property; } } throw IDMMessages.MESSAGES.credentialUnknownUserNameProperty(accountType); }
protected Property getDefaultLoginNameProperty(Class<? extends Account> accountType) { List<Property<Object>> properties = PropertyQueries .createQuery(accountType) .addCriteria(new AnnotatedPropertyCriteria(StereotypeProperty.class)).getResultList(); for (Property property : properties) { StereotypeProperty stereotypeProperty = property.getAnnotatedElement().getAnnotation(StereotypeProperty.class); if (StereotypeProperty.Property.IDENTITY_USER_NAME.equals(stereotypeProperty.value())) { return property; } } throw IDMMessages.MESSAGES.credentialUnknownUserNameProperty(accountType); }
protected Property getDefaultLoginNameProperty(Class<? extends Account> accountType) { List<Property<Object>> properties = PropertyQueries .createQuery(accountType) .addCriteria(new AnnotatedPropertyCriteria(StereotypeProperty.class)).getResultList(); for (Property property : properties) { StereotypeProperty stereotypeProperty = property.getAnnotatedElement().getAnnotation(StereotypeProperty.class); if (StereotypeProperty.Property.IDENTITY_USER_NAME.equals(stereotypeProperty.value())) { return property; } } throw IDMMessages.MESSAGES.credentialUnknownUserNameProperty(accountType); }