DboColumnMeta metaFieldDbo = typeInfo.getColumnInfo();
String colFamily = metaFieldDbo.getOwner().getColumnFamily();
String columnName = metaFieldDbo.getColumnName();
MetaClass metaClass = metaInfo.getMetaClass(colFamily);
MetaField metaField = metaClass.getMetaFieldByCol(targetSubclass, columnName);
Field field = metaField.getField();
Class fieldType = field.getType();
//Are actual type will never be a primitive because of autoboxing. When the param
//is passed in, it becomes an Long, Integer, etc. so we need to convert here
Class objectFieldType = DboColumnMeta.convertIfPrimitive(fieldType);
if(value!=null){
Class actualType = value.getClass();
if(!objectFieldType.isAssignableFrom(actualType)){
throw new TypeMismatchException("value [" + value
+ "] is not the correct type for the parameter='"+name+"' from inspecting the Entity. Type should be=["
+ fieldType + "]");
}
}
byte[] data = metaField.translateValue(value);
indexQuery.setParameter(name, data);
return this;
}