- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
public SimpleAttribute(IdentityObjectAttribute attribute) { this.name = attribute.getName(); this.values.addAll(attribute.getValues()); }
public IdentityObject findIdentityObjectByUniqueAttribute(IdentityStoreInvocationContext invocationCtx, IdentityObjectType identityObjectType, IdentityObjectAttribute attribute) throws IdentityException { if (attribute == null) { throw new IllegalArgumentException("attribute is null"); } checkIOType(identityObjectType); String attrMappedName = resolveAttributeStoreMapping(identityObjectType, attribute.getName()); HibernateIdentityObjectType hiot = getHibernateIdentityObjectType(invocationCtx, identityObjectType); Session session = getHibernateSession(invocationCtx); Query q = session.createQuery("select a from HibernateIdentityObjectTextAttribute a where a.identityObject.identityType = :identityType " + "and a.name like :attributeName and :value = any elements(a.values)"); Set attrValues = new HashSet(); attrValues.addAll(attribute.getValues()); List<HibernateIdentityObjectAttribute> attrs = (List<HibernateIdentityObjectAttribute>) q.setParameter("identityType", hiot) .setParameter("attributeName", attrMappedName) .setParameter("value", attribute.getValue()).list(); if (attrs.size() == 0) { return null; } if (attrs.size() > 1) { throw new IdentityException("Illegal state - more than one IdentityObject with the same unique attribute value: " + attribute); } return attrs.get(0).getIdentityObject(); }