How to get Enum from datamanager

I am using following code to get Enum value from datamanager, but getting error
ClassCastException: java.lang.String cannot be cast to com.sheel.environmentengineer.entity.EnumTargetType

This is my code

//get parameter monitoring type
            EnumTargetType tt = dataManager.loadValue(
                    "select o.standardType from environmentengineer_EffluentStreamParameter o " +
                            "where o.effluentStream = :eff and o.parameter = :par", EnumTargetType.class)
                    .parameter("eff", ef)
                    .parameter("par", pa)
                    .one();

This looks that only scalar values can be returned this way.

How can I get enum value?

regards

Umesh

Hi,

Perhaps it helps you one post made by me in this forum long time ago.

I hope it helps you.

Regards,
Xavier

Thanks @xlorentep

Hi Umesh,

Only number types are converted automatically (this is stated in the Javadocs). Now I see that we could also safely convert enums, but we cannot make this improvement in the current version as it will break compatibility. Created issue.

Regards,
Konstantin