Example usage for javax.persistence.metamodel Type equals

List of usage examples for javax.persistence.metamodel Type equals

Introduction

In this page you can find the example usage for javax.persistence.metamodel Type equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:com.impetus.kundera.query.KunderaQuery.java

/**
 * Filter jpa parameter info./*from ww  w . j a v a  2 s  . c  o m*/
 * 
 * @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));
    }
}