@Override public <Y> SingularAttribute<? super X, Y> getSingularAttribute(String paramString, Class<Y> paramClass) { SingularAttribute<? super X, Y> attribute = getDeclaredSingularAttribute(paramString, paramClass, false); if (superClazzType != null && attribute == null) { return superClazzType.getSingularAttribute(paramString, paramClass); } checkForValid(paramString, attribute); return attribute; }
/** * Gets the singular attribute. * * @param paramString * the param string * @param checkValidity * the check validity * @return the singular attribute */ private SingularAttribute<? super X, ?> getSingularAttribute(String paramString, boolean checkValidity) { SingularAttribute<? super X, ?> attribute = getDeclaredSingularAttribute(paramString, false); try { if (attribute == null && superClazzType != null) { attribute = superClazzType.getSingularAttribute(paramString); } } catch (IllegalArgumentException iaex) { attribute = null; onValidity(paramString, checkValidity, attribute); } onValidity(paramString, checkValidity, attribute); return attribute; }
public <T> SingularAttribute<? super T, String> stringAttribute(ManagedType<? super T> mt, Attribute<? super T, ?> attr) { return mt.getSingularAttribute(attr.getName(), String.class); }
public <T> SingularAttribute<? super T, String> stringAttribute(ManagedType<? super T> mt, Attribute<? super T, ?> attr) { return mt.getSingularAttribute(attr.getName(), String.class); }
public <T, A> SingularAttribute<? super T, A> attribute(ManagedType<? super T> mt, Attribute<? super T, A> attr) { return mt.getSingularAttribute(attr.getName(), attr.getJavaType()); }
public <T, A> SingularAttribute<? super T, A> attribute(ManagedType<? super T> mt, Attribute<? super T, A> attr) { return mt.getSingularAttribute(attr.getName(), attr.getJavaType()); }
private Attribute<?, ?> getAttribute(ManagedType<?> ownerType, String attributeName) { if (attributeName.indexOf('.') == -1) { return ownerType.getAttribute(attributeName); } ManagedType<?> t = ownerType; SingularAttribute<?, ?> attr = null; String[] parts = attributeName.split("\\."); for (int i = 0; i < parts.length; i++) { attr = t.getSingularAttribute(parts[i]); if (attr.getType().getPersistenceType() != Type.PersistenceType.BASIC) { t = (ManagedType<?>) attr.getType(); } else if (i + 1 != parts.length) { throw new IllegalArgumentException("Illegal attribute name for type [" + ownerType.getJavaType().getName() + "]: " + attributeName); } } return attr; }
private AttributeImpl<?, ?> getAttribute(ManagedType<?> ownerType, String attributeName) { if (attributeName.indexOf('.') == -1) { return (AttributeImpl<?, ?>) ownerType.getAttribute(attributeName); } ManagedType<?> t = ownerType; SingularAttribute<?, ?> attr = null; String[] parts = attributeName.split("\\."); for (int i = 0; i < parts.length; i++) { attr = t.getSingularAttribute(parts[i]); if (attr.getType().getPersistenceType() != Type.PersistenceType.BASIC) { t = (ManagedType<?>) attr.getType(); } else if (i + 1 != parts.length) { throw new IllegalArgumentException("Illegal attribute name for type [" + ownerType.getJavaType().getName() + "]: " + attributeName); } } return (AttributeImpl<?, ?>) attr; }
private AttributeImpl<?, ?> getAttribute(ManagedType<?> ownerType, String attributeName) { if (attributeName.indexOf('.') == -1) { return (AttributeImpl<?, ?>) ownerType.getAttribute(attributeName); } ManagedType<?> t = ownerType; SingularAttribute<?, ?> attr = null; String[] parts = attributeName.split("\\."); for (int i = 0; i < parts.length; i++) { attr = t.getSingularAttribute(parts[i]); if (attr.getType().getPersistenceType() != Type.PersistenceType.BASIC) { t = (ManagedType<?>) attr.getType(); } else if (i + 1 != parts.length) { throw new IllegalArgumentException("Illegal attribute name for type [" + ownerType.getJavaType().getName() + "]: " + attributeName); } } return (AttributeImpl<?, ?>) attr; }
private AttributeImpl<?, ?> getAttribute(ManagedType<?> ownerType, String attributeName) { if (attributeName.indexOf('.') == -1) { return (AttributeImpl<?, ?>) ownerType.getAttribute(attributeName); } ManagedType<?> t = ownerType; SingularAttribute<?, ?> attr = null; String[] parts = attributeName.split("\\."); for (int i = 0; i < parts.length; i++) { attr = t.getSingularAttribute(parts[i]); if (attr.getType().getPersistenceType() != Type.PersistenceType.BASIC) { t = (ManagedType<?>) attr.getType(); } else if (i + 1 != parts.length) { throw new IllegalArgumentException("Illegal attribute name for type [" + ownerType.getJavaType().getName() + "]: " + attributeName); } } return (AttributeImpl<?, ?>) attr; }