Enumerations are stored as strings in the database. The values of the enumeration are the values that are stored, so I think you should write your OQL treating the enum like a string.
So if your attribute called Priority has the possible values and captions like this:
1_Low Low
2_Medium Medium
3_High High
Then your query would be like:
WHERE Priority=’1_Low’
https://forum.mendix.com/link/questions/90339 gave me a good lead
function getCaption() extract enumeration value usable in OQL statement
'
select
ContentNo as entityId,
Title as Title,
ShortDescription as Description,
ContentType as Origin,
NoLikes as NoLikes,
NoViews as NoViews,
NoRate as NoRates
from General.Content
where' +
' (Title like ' + '''%' +
$TempSearch/searchInput
+ '%''' +
' or ShortDescription like ' + '''%' +
$TempSearch/searchInput
+ '%''' +
' ) and (ContentType = ' + '''' +
getCaption($TempSearch/ContentType)
+ ''')'