@Override public String toString() { StringBuilder strBuilder = new StringBuilder(); strBuilder.append("[ name = " + this.getName() + "]"); strBuilder.append("[ position = " + this.getPosition() + "]"); strBuilder.append("[ type = " + this.getParameterType() + "]"); return strBuilder.toString(); } }
/** * Filter jpa parameter info. * * @param type * the type * @param name * the name * @param fieldName * the field name */ private void filterJPAParameterInfo(Type type, String name, String fieldName) { String attributeName = getAttributeName(fieldName); Attribute entityAttribute = ((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(persistenceUnit)) .getEntityAttribute(entityClass, attributeName); Class fieldType = entityAttribute.getJavaType(); if (type.equals(Type.INDEXED)) { typedParameter.addJPAParameter(new JPAParameter(null, Integer.valueOf(name), fieldType)); } else { typedParameter.addJPAParameter(new JPAParameter(name, null, fieldType)); } }
@Override public boolean equals(Object obj) { if (obj == null) { return false; } if (!obj.getClass().equals(this.getClass())) { return false; } Parameter<?> typed = (Parameter<?>) obj; if (typed.getParameterType().equals(this.getParameterType())) { if (this.getName() == null && typed.getName() == null) { return this.getPosition() != null && this.getPosition().equals(typed.getPosition()); } else { return this.getName() != null && this.getName().equals(typed.getName()); } } return false; }